mariadb安装后,非root无法mysql登录

系统

Ubuntu 16

安装方式

sudo apt-get install mariadb-server python-pymysql 

** 两个疑问 **

  1. 非系统root不能通过mysql登录
  2. MariaDB 接受空用户登录, 如何取消? user表没有

求科普, 感激不尽!

** 说明 **

  • mysql已确认开启
 nginx@nginx-virtual-machine:~$ service mysql status

● mysql.service - LSB: Start and stop the mysql database server daemon
   Loaded: loaded (/etc/init.d/mysql; bad; vendor preset: enabled)
   Active: active (running) since Wed 2017-09-27 19:17:51 ULAST; 16h ago
     Docs: man:systemd-sysv-generator(8)
  Process: 29567 ExecStop=/etc/init.d/mysql stop (code=exited, status=0/SUCCESS)
  Process: 29603 ExecStart=/etc/init.d/mysql start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/mysql.service
           ├─29633 /bin/bash /usr/bin/mysqld_safe
           ├─29777 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/m
           └─29778 logger -t mysqld -p daemon error

  • root登录
nginx@nginx-virtual-machine:~$ sudo mysql -uroot -psqlpass

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 46
Server version: 10.0.31-MariaDB-0ubuntu0.16.04.2 Ubuntu 16.04
Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| my_test            |
| mysql              |
| performance_schema |
+--------------------+
4 rows in set (0.00 sec)

MariaDB [(none)]> 

  • 非root登录
nginx@nginx-virtual-machine:~$ mysql -uroot -psqlpass
ERROR 1698 (28000): Access denied for user 'root'@'localhost'
  • root用户, 空用户登录
root@nginx-virtual-machine:/home/nginx# mysql

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 48
Server version: 10.0.31-MariaDB-0ubuntu0.16.04.2 Ubuntu 16.04
Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> 

但是查询不到默认用户

MariaDB [mysql]> select * from user where 0 = length(User);
Empty set (0.00 sec)

MariaDB [mysql]> select count(1) from user;
+----------+
| count(1) |
+----------+
|        1 |
+----------+
1 row in set (0.00 sec)

通过安全加固删除匿名账户后, 任然可以匿名登录.

nginx@nginx-virtual-machine:~$ sudo mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none): 
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

You already have a root password set, so you can safely answer 'n'.

Change the root password? [Y/n] n
 ... skipping.

By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y
 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

1个回答

给非root用户加权限就可以了

Gozs_cs_dn
蓝色雨点 非常感谢
2 年多之前 回复
qq_33427422
子系天下 回复蓝色雨点: 你百度一下,linux查找文件
2 年多之前 回复
Gozs_cs_dn
蓝色雨点 关键是找不到 apt-get install 安装的东西在哪, linux 新手
2 年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
求助mariadb安装后启动不了的问题

虚拟机上的cent0s6.2,安装mariadb5.5.20,按照以下步骤安装: shell> groupadd mysql shell> useradd -g mysql mysql shell> cd /usr/local shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf - shell> ln -s full-path-to-mysql-VERSION-OS mysql shell> cd mysql shell> chown -R mysql . shell> chgrp -R mysql . shell> scripts/mysql_install_db --user=mysql shell> chown -R root . shell> chown -R mysql data shell> bin/mysqld_safe --user=mysql & 最后一步报错: [root@localhost mariadb-5.5.20-linux-x86_64]# bin/mysqld_safe --user=mysql & [1] 3074 [root@localhost mariadb-5.5.20-linux-x86_64]# 170406 05:10:57 mysqld_safe Logging to '/usr/local/mariadb-5.5.20-linux-x86_64/data/localhost.localdomain.err'. 170406 05:10:57 mysqld_safe Starting mysqld daemon with databases from /usr/local/mariadb-5.5.20-linux-x86_64/data 170406 05:11:00 mysqld_safe mysqld from pid file /usr/local/mariadb-5.5.20-linux-x86_64/data/localhost.localdomain.pid ended [1]+ Done bin/mysqld_safe --user=mysql 求助,这个百度了好长时间,没找到合适的解决方法。

mariadb随便输入账号不用输入密码按Enter键就可以登录进去

mariadb随便输入账号不用输入密码按Enter键就可以登录进去

phpMyAdmin无法登录 MySQL 服务器

显示“使用配置文件中定义的控制用户连接失败”和“无法登录 MySQL 服务器”,密码正确,xampps上显示数据库已经启动,但xampps数据库管理那里也显示无法连接数据库

Linux 安装 MySQL 到mysql_install_db --user=mysql执行出错

linux 手动编译安装 mysql 完成后 执行 /usr/local/mysql/bin/mysql_install_db --user=mysql 出错.. 以下是错误信息.. 我还是没太明白... 帮忙看下... Installing MySQL system tables... 110823 20:55:57 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead. /usr/local/mysql/libexec/mysqld: File './mysql-bin.index' not found (Errcode: 13) 110823 20:55:57 [ERROR] Aborting 110823 20:55:57 [Note] /usr/local/mysql/libexec/mysqld: Shutdown complete Installation of system tables failed! Examine the logs in /var/lib/mysql for more information. You can try to start the mysqld daemon with: shell> /usr/local/mysql/libexec/mysqld --skip-grant & and use the command line tool /usr/local/mysql/bin/mysql to connect to the mysql database and look at the grant tables: shell> /usr/local/mysql/bin/mysql -u root mysql mysql> show tables Try 'mysqld --help' if you have problems with paths. Using --log gives you a log in /var/lib/mysql that may be helpful. Please consult the MySQL manual section 'Problems running mysql_install_db', and the manual section that describes problems on your OS. Another information source are the MySQL email archives available at http://lists.mysql.com/. Please check all of the above before mailing us! And remember, if you do mail us, you MUST use the /usr/local/mysql/bin/mysqlbug script!

MySQL 命令行登陆问题

求教各位大神 我下载的MySQL是64位安装版的5.6 然后如何可以通过命令行登陆。我用cmd登录时候出现这样的问题 ![图片说明](https://img-ask.csdn.net/upload/201603/24/1458810884_859329.png) 我看了环境变量是配置了的呀。难道是版本问题嘛?求大神教我。

linux 安装 mysql 后出现的问题

我的安装步骤如下: 1. 下载mysql-5.6.33-linux-glibc2.5-x86_64.tar.gz 文件 2.解压_到 /usr/local/mysqlService/目录下 ,解压后的文件夹重命名为mysql 3、运行安装目录下面的 scripts/mysql_install_db 进行安装 4、编辑 /etc/my.cnf 配置如下: [root@localhost ~]# cat /etc/my.cnf [client] socket = /tmp/mysql.sock [mysqld] #character-set-server=utf8 datadir=/usr/local/mysqlService/mysql/data basedir=/usr/local/mysqlService/mysql socket=/tmp/mysql.sock # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 # Settings user and group are ignored when systemd is used. # If you need to run mysqld under a different user or group, # customize your systemd unit file for mariadb according to the # instructions in http://fedoraproject.org/wiki/Systemd [mysqld_safe] log-error=/usr/local/mysqlService/mysql/log/mysqld.log pid-file=/var/run/mariadb/mariadb.pid # # include all files from the config directory # !includedir /etc/my.cnf.d [root@localhost ~]# 5、 /etc/my.cnf 中的 socket = /tmp/mysql.sock 是我照着网上写的,我并没有找到mysql.sock 这个文件 6、开始运行 #service mysql start 报错: 170518 17:11:11 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysqlService/mysql/data 2017-05-18 17:11:11 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for m ore details). 2017-05-18 17:11:11 0 [Note] /usr/local/mysqlService/mysql/bin/mysqld (mysqld 5.6.33) starting as process 27678 ... 2017-05-18 17:11:11 27678 [Note] Plugin 'FEDERATED' is disabled. /usr/local/mysqlService/mysql/bin/mysqld: Table 'mysql.plugin' doesn't exist 2017-05-18 17:11:11 27678 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. 2017-05-18 17:11:11 27678 [Note] InnoDB: Using atomics to ref count buffer pool pages 2017-05-18 17:11:11 27678 [Note] InnoDB: The InnoDB memory heap is disabled 2017-05-18 17:11:11 27678 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 2017-05-18 17:11:11 27678 [Note] InnoDB: Memory barrier is not used 2017-05-18 17:11:11 27678 [Note] InnoDB: Compressed tables use zlib 1.2.3 2017-05-18 17:11:11 27678 [Note] InnoDB: Using Linux native AIO 2017-05-18 17:11:11 27678 [Note] InnoDB: Using CPU crc32 instructions 2017-05-18 17:11:11 27678 [Note] InnoDB: Initializing buffer pool, size = 128.0M 2017-05-18 17:11:11 27678 [Note] InnoDB: Completed initialization of buffer pool 2017-05-18 17:11:11 27678 [Note] InnoDB: Highest supported file format is Barracuda. 2017-05-18 17:11:11 27678 [Note] InnoDB: Log scan progressed past the checkpoint lsn 49463 2017-05-18 17:11:11 27678 [Note] InnoDB: Database was not shutdown normally! 2017-05-18 17:11:11 27678 [Note] InnoDB: Starting crash recovery. 2017-05-18 17:11:11 27678 [Note] InnoDB: Reading tablespace information from the .ibd files... 2017-05-18 17:11:11 27678 [Note] InnoDB: Restoring possible half-written data pages 2017-05-18 17:11:11 27678 [Note] InnoDB: from the doublewrite buffer... InnoDB: Doing recovery: scanned up to log sequence number 1600607 2017-05-18 17:11:11 27678 [Note] InnoDB: Starting an apply batch of log records to the database... InnoDB: Progress in percent: 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 7 4 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 InnoDB: Apply batch completed 2017-05-18 17:11:12 27678 [Note] InnoDB: 128 rollback segment(s) are active. 2017-05-18 17:11:12 27678 [Note] InnoDB: Waiting for purge to start 2017-05-18 17:11:12 27678 [Note] InnoDB: 5.6.33 started; log sequence number 1600607 2017-05-18 17:11:12 27678 [Note] Server hostname (bind-address): '*'; port: 3306 2017-05-18 17:11:12 27678 [Note] IPv6 is available. 2017-05-18 17:11:12 27678 [Note] - '::' resolves to '::'; 2017-05-18 17:11:12 27678 [Note] Server socket created on IP: '::'. 2017-05-18 17:11:12 27678 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist 170518 17:11:12 mysqld_safe mysqld from pid file /usr/local/mysqlService/mysql/data/localhost.localdomain.pid ended 到目前为止,一直报这个错误,我目前还觉得是哪里配置出现了问题,但是网上找了一天,一点进展都没有。希望大神们看到能够帮助我解决这个问题。

linux下mysql启动问题

我的mysql已经安装好了,但好像登陆不进去,启动不起来。麻烦各位帮我看一下,谢谢。 1.  在mysql的bin目录下执行如下命令:service mysql start   执行结果如下:           Starting MySQL         . *  这能说明我安装成功了吗? 2. 在mysql的bin目录下执行如下命令:mysql -uroot -p     结果如下:    程序 'mysql' 已包含在下列软件包中:   * mysql-client-core-5.5   * mariadb-client-core-5.5   * mysql-client-core-5.6   * percona-xtradb-cluster-client-5.5 请尝试:apt-get install <选定的软件包> 这是为什么?

Docker - Ubuntu - Nginx - MariaDB - 连接被拒绝

<div class="post-text" itemprop="text"> <p>Im trying to setup a docker container on OSX with Docker - Ubuntu - Nginx - MariaDB to run a Laravel App</p> <p>My docker settings are:</p> <pre><code>version: "2" services: nginx: build: context: ./nginx ports: - "8080:80" volumes: - ./app:/var/app fpm: build: context: ./fpm volumes: - ./app:/var/app expose: - "9000" environment: - "DB_HOST=db" - "DB_DATABASE=laravel_db" db: image: mariadb ports: - "33061:3306" environment: - MYSQL_ROOT_PASSWORD=root - MYSQL_DATABASE=laravel_db volumes: - ./database:/var/lib/mysql </code></pre> <p>And the 2 docker files:</p> <pre><code>FROM nginx ADD ./default.conf /etc/nginx/conf.d/ RUN echo "daemon off;" &gt;&gt; /etc/nginx/nginx.conf CMD service nginx start </code></pre> <hr> <pre><code>FROM ubuntu:latest RUN apt-get update &amp;&amp; apt-get install -y software-properties-common language-pack-en-base \ &amp;&amp; LC_ALL=en_US.UTF-8 add-apt-repository -y ppa:ondrej/php \ &amp;&amp; apt-get update \ &amp;&amp; apt-get install -y php7.0 php7.0-fpm php7.0-mysql mcrypt php7.0-gd curl \ php7.0-curl php-redis php7.0-mbstring sendmail supervisor \ &amp;&amp; mkdir /run/php \ &amp;&amp; apt-get clean &amp;&amp; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf RUN sed -i -e 's/listen = \/run\/php\/php7.0-fpm.sock/listen = 0.0.0.0:9000/g' /etc/php/7.0/fpm/pool.d/www.conf \ &amp;&amp; sed -i -e 's/;daemonize = yes/daemonize = no/g' /etc/php/7.0/fpm/php-fpm.conf WORKDIR /var/app EXPOSE 9000 CMD ["/usr/bin/supervisord"] </code></pre> <p>So far so good. I can access the Laravel App homepage as <strong>localhost:8080</strong> and use Sequel Pro to access the MySQL DB.</p> <p>But when access to the Laravel route that requires DB query, it returns "Connection refused"</p> <p>Then I create a raw PHP file to make a DB connection test:</p> <pre><code>$link = mysqli_connect('127.0.0.1', 'root', 'root', 'laravel_db', 33061); if(!$link) { die('failed to connect to the server: ' . mysqli_connect_error()); } </code></pre> <p>And I get connection refused error as well.</p> <p>I tried using 127.0.0.1 and localhost but no hope.</p> <p>Tried to google it but most answers are about ports are not published...</p> <p>Thanks</p> </div>

PHP MARIADB PHPMYADMIN使用docker-compose的问题

<div class="post-text" itemprop="text"> <p>I've been this last two weeks searching how to link my phpmyadmin and my database, to create a PHP development workspace, through docker-compose but I am not able to connect to the database through the phpmyadmin port. </p> <pre><code> version: '3' services: servicio_php: image: php:7.3-rc-apache volumes: - ./web/:/var/www/html expose: - "80" ports: - "80:80" links: - db db: image: mariadb:latest restart: always volumes: - ./Volumenes/mysql:/var/lib/mysql environment: MYSQL_ROOT_PASSWORD: root123 MYSQL_USER: user MYSQL_PASSWORD: user123 MYSQL_DATABASE: bbdd1 expose: - "3306" ports: - "3306:3306" phpmyadmin: image: phpmyadmin/phpmyadmin:latest container_name: phpmyadmin environment: PMA_ARBITRARY: 1 MYSQL_ROOT_PASSWORD: root123 MYSQL_USERNAME: user PMA_HOST: db MYSQL_PASSWORD: user123 restart: always ports: - "8080:80" volumes: - ./sessions:/sessions/ depends_on: - db links: - db </code></pre> <p>I am using windows 10 version of dockers 18.06.1-ce and also when i run docker-compose up i see there are some probles with Innodb but ive read is not a problem. </p> <p>I am not able to see whats wrong and probably I am not the only one with this problem.</p> </div>

centos6安装mysql5.7出错:yum install mysql-community-server出错

安装mysql5.7,参考教程:https://www.php.cn/mysql-tutorials-386847.html 一开始不知道 地址中的el7应该对应自己的centos版本,直接执行该命令进行下载 ``` wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm ``` 然后执行以下命令也没有报错, ``` yum -y localinstall mysql57-community-release-el7-11.noarch.rpm ``` 但是执行下面命令的时候一直报错 ``` yum -y install mysql-community-server ``` 之后重新下载centos6的版本,安装源 ``` # wget https://dev.mysql.com/get/mysql57-community-release-el6-11.noarch.rpm # yum -y localinstall mysql57-community-release-el6-11.noarch.rpm ``` 然而进行安装的时候还是报错 ``` yum -y install mysql-community-server ``` 原因在于他还是跑去安装el7的版本了 ``` ---> Package mysql-community-server.i686 0:5.7.17-1.el7 will be 安装 ``` 尝试了各种方法,重装了好多次,能删除的就删除,结果一直都是这样 获取mysql-community-server的信息,结果如下: ![图片说明](https://img-ask.csdn.net/upload/201907/25/1563987255_628071.png) 尝试删除无果: ``` [root@localhost ~]# yum remove mysql-community-server 已加载插件:fastestmirror, security 设置移除进程 参数 mysql-community-server 没有匹配 Loading mirror speeds from cached hostfile Package(s) mysql-community-server available, but not installed. 不删除任何软件包 ``` 真的搞了一天,心累啊!如果哪个好心人看到,可以提点提点,真的万分感谢!

小白安装perl-DBD-MySQL出现这样的错误

[root@xxxx ~]# yum install perl-DBD-MySQL Loaded plugins: security Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package perl-DBD-MySQL.x86_64 0:4.013-3.el6 will be installed --> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16)(64bit) for package: perl-DBD-MySQL-4.013-3.el6.x86_64 --> Processing Dependency: libmysqlclient.so.16()(64bit) for package: perl-DBD-MySQL-4.013-3.el6.x86_64 --> Running transaction check ---> Package mysql-libs.x86_64 0:5.1.73-5.el6_6 will be installed --> Finished Dependency Resolution Dependencies Resolved ============================================================================================================================================================================== Package Arch Version Repository Size ============================================================================================================================================================================== Installing: perl-DBD-MySQL x86_64 4.013-3.el6 base 134 k Installing for dependencies: mysql-libs x86_64 5.1.73-5.el6_6 base 1.2 M Transaction Summary ============================================================================================================================================================================== Install 2 Package(s) Total size: 1.4 M Installed size: 4.4 M Is this ok [y/N]: y Downloading Packages: Running rpm_check_debug Running Transaction Test Transaction Check Error: file /usr/share/mysql/charsets/Index.xml from install of mysql-libs-5.1.73-5.el6_6.x86_64 conflicts with file from package MySQL-server-5.6.20-1.el6.x86_64 file /usr/share/mysql/charsets/armscii8.xml from install of mysql-libs-5.1.73-5.el6_6.x86_64 conflicts with file from package MySQL-server-5.6.20-1.el6.x86_64 file /usr/share/mysql/charsets/ascii.xml from install of mysql-libs-5.1.73-5.el6_6.x86_64 conflicts with file from package MySQL-server-5.6.20-1.el6.x86_64 file /usr/share/mysql/charsets/cp1250.xml from install of mysql-libs-5.1.73-5.el6_6.x86_64 conflicts with file from package MySQL-server-5.6.20-1.el6.x86_64 file /usr/share/mysql/charsets/cp1256.xml from install of mysql-libs-5.1.73-5.el6_6.x86_64 conflicts with file from package MySQL-server-5.6.20-1.el6.x86_64 file /usr/share/mysql/charsets/cp1257.xml from install of mysql-libs-5.1.73-5.el6_6.x86_64 conflicts with file from package MySQL-server-5.6.20-1.el6.x86_64 file /usr/share/mysql/charsets/cp850.xml from install of mysql-libs-5.1.73-5.el6_6.x86_64 conflicts with file from package MySQL-server-5.6.20-1.el6.x86_64 file /usr/share/mysql/charsets/cp852.xml from install of mysql-libs-5.1.73-5.el6_6.x86_64 conflicts with file from package MySQL-server-5.6.20-1.el6.x86_64 file /usr/share/mysql/charsets/cp866.xml from install of mysql-libs-5.1.73-5.el6_6.x86_64 conflicts with file from package MySQL-server-5.6.20-1.el6.x86_64 file /usr/share/mysql/charsets/dec8.xml from install of mysql-libs-5.1.73-5.el6_6.x86_64 conflicts with file from package MySQL-server-5.6.20-1.el6.x86_64 file /usr/share/mysql/charsets/geostd8.xml from install of mysql-libs-5.1.73-5.el6_6.x86_64 conflicts with file from package MySQL-server-5.6.20-1.el6.x86_64 file /usr/share/mysql/charsets/greek.xml from install of mysql-libs-5.1.73-5.el6_6.x86_64 conflicts with file from package MySQL-server-5.6.20-1.el6.x86_64 file /usr/share/mysql/charsets/hebrew.xml from install of mysql-libs-5.1.73-5.el6_6.x86_64 conflicts with file from package MySQL-server-5.6.20-1.el6.x86_64 file /usr/share/mysql/charsets/hp8.xml from install of mysql-libs-5.1.73-5.el6_6.x86_64 conflicts with file from package MySQL-server-5.6.20-1.el6.x86_64 file /usr/share/mysql/charsets/keybcs2.xml from install of mysql-libs-5.1.73-5.el6_6.x86_64 conflicts with file from package MySQL-server-5.6.20-1.el6.x86_64 mysql 为5.6

Ubuntu16.04 修改mysql 数据存储目录datadir 启动失败

Ubuntu16.04 修改mysql 数据存储目录datadir 启动失败 ,网上的各种方法都已经尝试,但是还是没有启动成功请教各位大神!!!!! 修改步骤 ## 创建 迁移文件夹 > cd /mnt > mkdir lib > cd lib && mkdir mysqldata > 数据存放在 /mnt/lib/mysqldata 修改所属用户 和所属用户组为 msyql > sudo chown -vR mysql:mysql /mnt/lib/mysqldata 修改权限 > sudo chmod -vR 700 /mnt/lib/mysqldata ### 迁移文件 停止服务 > sudo /etc/init.d/mysql stop 迁移数据 > cp -av /var/lib/mysql/* /mnt/lib/mysqldata # vim /etc/mysql/mysql.conf.d/mysqld.cnf 将 [mysqld] 组下的 datadir改为: datadir = /mnt/lib/mysqldata sudo vim /etc/apparmor.d/usr.sbin.mysqld 找到其中的 /var/lib/mysql/ r, /var/lib/mysql/** rwk, 两行权限声明,可以在前面加上#好注释掉。然后对照格式,加入新路径的权限声明: /mnt/lib/mysqldata/ r, /mnt/lib/mysqldata/** rwk 重启服务 配置文件修改成功后就可以重启数据库,重启数据库之前需要先重新载入apparmor配置文件,使用下面命令重新载入: > sudo /etc/init.d/apparmor restart >sudo /etc/init.d/mysql start 重启的时候 Starting mysql (via systemctl): mysql.serviceJob for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details. failed! root@iZm5e472vz1trxejt8m5akZ:/etc/mysql# systemctl status mysql.service ● mysql.service - MySQL Community Server Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled) Active: active (running) since Sat 2018-06-23 00:55:37 CST; 25s ago Process: 13418 ExecStartPost=/usr/share/mysql/mysql-systemd-start post (code=exited, status=0/SUCCESS) Process: 13408 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS) Main PID: 13417 (mysqld) CGroup: /system.slice/mysql.service └─13417 /usr/sbin/mysqld . 配置文件 内容 ``` # # The MySQL database server configuration file. # # You can copy this to one of: # - "/etc/mysql/my.cnf" to set global options, # - "~/.my.cnf" to set user-specific options. # # One can use all long options that the program supports. # Run program with --help to get a list of available options and with # --print-defaults to see which it would actually understand and use. # # For explanations see # http://dev.mysql.com/doc/mysql/en/server-system-variables.html # This will be passed to all mysql clients # It has been reported that passwords should be enclosed with ticks/quotes # escpecially if they contain "#" chars... # Remember to edit /etc/mysql/debian.cnf when changing the socket location. # Here is entries for some specific programs # The following values assume you have at least 32M ram [mysqld_safe] socket = /var/run/mysqld/mysqld.sock nice = 0 [mysqld] # # * Basic Settings # user = mysql pid-file = /var/run/mysqld/mysqld.pid socket = /var/run/mysqld/mysqld.sock port = 3306 basedir = /usr # datadir = /var/lib/mysql datadir = /mnt/lib/mysqldata tmpdir = /tmp lc-messages-dir = /usr/share/mysql skip-external-locking # # Instead of skip-networking the default is now to listen only on # localhost which is more compatible and is not less secure. bind-address = 0.0.0.0 # # * Fine Tuning # key_buffer_size = 16M max_allowed_packet = 16M thread_stack = 192K thread_cache_size = 8 # This replaces the startup script and checks MyISAM tables if needed # the first time they are touched myisam-recover-options = BACKUP #max_connections = 100 #table_cache = 64 #thread_concurrency = 10 # # * Query Cache Configuration # query_cache_limit = 1M query_cache_size = 16M # # * Logging and Replication # # Both location gets rotated by the cronjob. # Be aware that this log type is a performance killer. # As of 5.1 you can enable the log at runtime! #general_log_file = /var/log/mysql/mysql.log #general_log = 1 # # Error log - should be very few entries. # log_error = /var/log/mysql/error.log # # Here you can see queries with especially long duration #log_slow_queries = /var/log/mysql/mysql-slow.log #long_query_time = 2 #log-queries-not-using-indexes # # The following can be used as easy to replay backup logs or for replication. # note: if you are setting up a replication slave, see README.Debian about # other settings you may need to change. #server-id = 1 #log_bin = /var/log/mysql/mysql-bin.log expire_logs_days = 10 max_binlog_size = 100M #binlog_do_db = include_database_name #binlog_ignore_db = include_database_name # # * InnoDB # # InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/. # Read the manual for more InnoDB related options. There are many! # # * Security Features # # Read the manual, too, if you want chroot! # chroot = /var/lib/mysql/ # # For generating SSL certificates I recommend the OpenSSL GUI "tinyca". # # ssl-ca=/etc/mysql/cacert.pem # ssl-cert=/etc/mysql/server-cert.pem # ssl-key=/etc/mysql/server-key.pem ```

php mysql_connect不能用

``` error_reporting(E_ALL); echo 'hello'; $con = mysql_connect("127.0.0.1","root","password"); echo 'hello'; if($con){ echo '连接mysql数据库成功.<br>'; }else{ die('连接mysql数据库失败:' . mysql_error()); } mysql_close($con); echo '关闭mysql数据库连接.'; ``` 输出hello 如果换成就正常mysqli_connect() ![图片说明](https://img-ask.csdn.net/upload/201702/05/1486264548_538064.jpg)

连接到kubernetes mysql服务时,go-mysql连接被拒绝

<div class="post-text" itemprop="text"> <p>I have a problem when connecting to a mysql instance with a go app using standard package. This is my connection string/log</p> <pre><code> [13 Nov 16 13:53 +0000] [INFO] connecting to MySQL.. root:awsomepass@tcp(a-mysql-0:3340)/db?charset=utf8&amp;parseTime=True&amp;loc=Local 2016/11/13 13:53:25 dial tcp 10.108.1.35:3340: getsockopt: connection refused </code></pre> <p>I tried </p> <pre><code>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION; </code></pre> <p>here is how I make connection, just basic, with string concatenation only</p> <pre><code>db, err := sql.Open("mysql", "root:awsomepass@tcp(a-mysql-0:3340)/db?charset=utf8&amp;parseTime=True&amp;loc=Local") if err != nil { log.Fatal(err) } </code></pre> <p>I can ping the service, connect to it with mysql-client from a different pod. </p> <pre><code> # can connect without port for service / # mysql -u root -h a-mysql-0 -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MySQL connection id is 11 Server version: 5.7.16 MySQL Community Server (GPL) Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MySQL [(none)]&gt; Ctrl-C -- exit! Aborted # can't' connect with port for service / # mysql -u root -h a-mysql-0:3340 -p Enter password: ERROR 2005 (HY000): Unknown MySQL server host 'a-mysql-0:3340' (-3) </code></pre> <p>and the mysql-service </p> <pre><code> ➜ stg git:(develop) ✗ kubectl describe svc a-mysql-0 Name: a-mysql-0 Namespace: default Labels: name=a-mysql-0 tier=database type=mysql Selector: name=a-mysql-0,tier=database Type: ClusterIP IP: None Port: a-mysql-0 3340/TCP Endpoints: 10.108.1.35:3340 Session Affinity: None No events. </code></pre> <p>Is there anything I have missed or permission?</p> </div>

cmake编译MySQL时报错:the source directory "xxx" does not exist 怎么解决啊

系统ubuntu 13.04 \ gcc version 4.7.3 \ cmake version 2.8.10.1 安装完cmake后,在mysql解压缩目录下,使用如下命令行: cmake . \ -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \ -DMYSQL_DATADIR=/data/mysql \ -DSYSCONFDIR=/etc \ -DWITH_MYISAM_STORAGE_ENGINE=1 \ -DWITH_INNOBASE_STORAGE_ENGINE=1 \ -DWITH_MEMORY_STORAGE_ENGINE=1 \ -DWITH_READLINE=1 \ -DMYSQL_UNIX_ADDR=/tmp/mysqld.sock \ -DMYSQL_TCP_PORT=3306 \ -DENABLED_LOCAL_INFILE=1 \ -DWITH_PARTITION_STORAGE_ENGINE=1 \ -DWITH_EXTRA_CHARSETS:STRING=utf8,gbk \ -DDEFAULT_CHARSET=utf8 \ -DDEFAULT_COLLATION=utf8_general_ci \ 报错,提示cake error:the source directory “/usr/local/src/software/mysql-5.6.11/DDEFAULT_COLLATION=utf8_general_ci” does not exist. 怎么回事啊?删掉最后一行,又会报倒数第二行找不到目录!

MariaDB避免死锁

<div class="post-text" itemprop="text"> <p>My original error was </p> <blockquote> <p>Error No: 1213 - Deadlock found when trying to get lock; try restarting transaction</p> </blockquote> <p>Okay, so I wrote a loop with max retries and a wait in between to try and get through the deadlocks. </p> <pre><code>$Try = 0; while (!$Result = $dbs-&gt;query($MySQL)) { $Try++; if ($Try === MYSQL_MAX_RETRIES) HandleMySQLError($dbs-&gt;error, $MySQL, false, $Test, $Trace); else sleep(MYSQL_RETRY_WAIT); } </code></pre> <p>But now I'm constantly getting some of the original error still, and a new error </p> <blockquote> <p>Got error 35 "Resource deadlock avoided" during COMMIT</p> </blockquote> <p>But I can't really seem to find out what this means or how to fix it?</p> <hr> <p><strong>EDIT</strong></p> <p>I left out a ton of information when I first wrote this, but the server is a RedHat 7 AWS EC2 (well, 3 of them) in a Galera &amp; MariaDB cluster.</p> <p>The query I am running is a call to a stored procedure </p> <pre><code>call`getchatmessages`('&lt;ChatID&gt;','&lt;UserID&gt;',from_unixtime('&lt;Some Timestamp&gt;')); </code></pre> <p>And the stored procedure is as follows</p> <pre><code>CREATE DEFINER=`root`@`%` PROCEDURE `getchatmessages`(IN `__ChatID` CHAR(36), IN `__UserID` CHAR(36), IN `__Timestamp` TIMESTAMP(6)) BEGIN DECLARE `__NewChatMessages` TINYINT(1) DEFAULT 0; DECLARE `__i` INT(11) DEFAULT 0; DECLARE `__Interval` INT(11) DEFAULT 100; -- ms DECLARE `__Timeout` INT(11) DEFAULT 15000; -- ms while `__NewChatMessages`=0 and `__i`&lt;`__Timeout`/`__Interval` do select 1 into `__NewChatMessages` from `chatmessages` where `ChatID`=`__ChatID` and `DateTimeAdded`&gt;ifnull(`__Timestamp`,0) limit 1; update `chatusers` set `DateTimeRead`=now(6) where `ChatID`=`__ChatID` and `UserID`=`__UserID`; do sleep(`__Interval`/1000); set `__i`=`__i`+1; end while; select `chatmessages`.`Body`, `chatmessages`.`ChatID`, `chatmessages`.`UserID`, `chatmessages`.`ChatMessageID`, `chatmessages`.`DateTimeAdded`, UNIX_TIMESTAMP(`chatmessages`.`DateTimeAdded`) `Timestamp`, `users`.`FirstName`, `users`.`LastName` from `chatmessages` join `users` using (`UserID`) where `chatmessages`.`ChatID`=`__ChatID` and `chatmessages`.`DateTimeAdded`&gt;ifnull(`__Timestamp`,0) order by `chatmessages`.`DateTimeAdded` desc limit 100; END </code></pre> </div>

不允许主机'xxx.xx.xxx.xxx'连接到此 MySQL 服务器

<div class="post-text" itemprop="text"> <p>This should be dead simple, but I <em>cannot</em> get it to work for the life of me.<br> I'm just trying to connect remotely to my MySQL server.</p> <p>connecting as</p> <pre><code>mysql -u root -h localhost -p </code></pre> <p>works fine, but trying </p> <pre><code>mysql -u root -h 'any ip address here' -p </code></pre> <p>fails with the error</p> <pre><code>ERROR 1130 (00000): Host ''xxx.xx.xxx.xxx'' is not allowed to connect to this MySQL server </code></pre> <p>In the <code>mysql.user</code> table, there is exactly the same entry for user 'root' with host 'localhost' as another with host '%'.</p> <p>I'm at my wits' end, and have no idea how to proceed. Any ideas are welcome.</p> </div> <p>转载于:https://stackoverflow.com/questions/1559955/host-xxx-xx-xxx-xxx-is-not-allowed-to-connect-to-this-mysql-server</p>

如何将数据插入PHP中的列到MariaDB?

<div class="post-text" itemprop="text"> <p>I am familiar with MySql databases but there is this new database called MariaDB. I try to insert data there from PHP code and I can't, so can you help me insert the data? My PHP on the server is 5.4.32 and my MySQL version is 10.0.20-MariaDB-cll-live.</p> <p>This is the code that I am using to try to insert data into MariaDB.</p> <pre><code>$connection = mysql_connect("localhost", "root", ""); // Establishing Connection with Server $db = mysql_select_db("database", $connection); // Selecting Database from Server if(isset($_POST['submit'])){ // Fetching variables of the form which travels in URL $name = $_POST['name']; $email = $_POST['email']; if($name !=''||$email !=''){ //Insert Query of SQL $query = mysql_query("insert into VIP Membership(Name, Email) values ('$name', '$email')"); echo "&lt;br/&gt;&lt;br/&gt;&lt;span&gt;Data Inserted successfully...!!&lt;/span&gt;"; } else{ echo "&lt;p&gt;Insertion Failed &lt;br/&gt; Some Fields are Blank....!!&lt;/p&gt;"; } } mysql_close($connection); // Closing Connection with Server </code></pre> <p>EDIT: I used the mysqli code now but it throws me an error 500.</p> <pre><code>&lt;?php $servername = "localhost"; $username = "username"; $password = ""; $dbname = "db_table"; // Create connection $conn = mysqli_connect($servername, $username, $password, $dbname); // Check connection if (!$conn) { die("Connection failed: " . mysqli_connect_error()); } if(isset($_POST['submit'])){ // Fetching variables of the form which travels in URL $name = $_POST['name']; $email = $_POST['email']; if($name !=''||$email !=''){ $sql = "INSERT INTO 'VIP Membership' (Name, Email) VALUES ('$name', '$email')"; if(mysqli_query($conn, $sql)) { echo "New record created successfully"; } else { echo "Error: " . $sql . "&lt;br&gt;" . mysqli_error($conn); } } mysqli_close($conn); </code></pre> </div>

大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了

大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

Java基础知识面试题(2020最新版)

文章目录Java概述何为编程什么是Javajdk1.5之后的三大版本JVM、JRE和JDK的关系什么是跨平台性?原理是什么Java语言有哪些特点什么是字节码?采用字节码的最大好处是什么什么是Java程序的主类?应用程序和小程序的主类有何不同?Java应用程序与小程序之间有那些差别?Java和C++的区别Oracle JDK 和 OpenJDK 的对比基础语法数据类型Java有哪些数据类型switc...

我以为我学懂了数据结构,直到看了这个导图才发现,我错了

数据结构与算法思维导图

String s = new String(" a ") 到底产生几个对象?

老生常谈的一个梗,到2020了还在争论,你们一天天的,哎哎哎,我不是针对你一个,我是说在座的各位都是人才! 上图红色的这3个箭头,对于通过new产生一个字符串(”宜春”)时,会先去常量池中查找是否已经有了”宜春”对象,如果没有则在常量池中创建一个此字符串对象,然后堆中再创建一个常量池中此”宜春”对象的拷贝对象。 也就是说准确答案是产生了一个或两个对象,如果常量池中原来没有 ”宜春” ,就是两个。...

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

Linux面试题(2020最新版)

文章目录Linux 概述什么是LinuxUnix和Linux有什么区别?什么是 Linux 内核?Linux的基本组件是什么?Linux 的体系结构BASH和DOS之间的基本区别是什么?Linux 开机启动过程?Linux系统缺省的运行级别?Linux 使用的进程间通信方式?Linux 有哪些系统日志文件?Linux系统安装多个桌面环境有帮助吗?什么是交换空间?什么是root帐户什么是LILO?什...

Linux命令学习神器!命令看不懂直接给你解释!

大家都知道,Linux 系统有非常多的命令,而且每个命令又有非常多的用法,想要全部记住所有命令的所有用法,恐怕是一件不可能完成的任务。 一般情况下,我们学习一个命令时,要么直接百度去搜索它的用法,要么就直接用 man 命令去查看守冗长的帮助手册。这两个都可以实现我们的目标,但有没有更简便的方式呢? 答案是必须有的!今天给大家推荐一款有趣而实用学习神器 — kmdr,让你解锁 Linux 学习新姿势...

和黑客斗争的 6 天!

互联网公司工作,很难避免不和黑客们打交道,我呆过的两家互联网公司,几乎每月每天每分钟都有黑客在公司网站上扫描。有的是寻找 Sql 注入的缺口,有的是寻找线上服务器可能存在的漏洞,大部分都...

史上最全的 python 基础知识汇总篇,没有比这再全面的了,建议收藏

网友们有福了,小编终于把基础篇的内容全部涉略了一遍,这是一篇关于基础知识的汇总的文章,请朋友们收下,不用客气,不过文章篇幅肯能会有点长,耐心阅读吧爬虫(七十)多进程multiproces...

讲一个程序员如何副业月赚三万的真实故事

loonggg读完需要3分钟速读仅需 1 分钟大家好,我是你们的校长。我之前讲过,这年头,只要肯动脑,肯行动,程序员凭借自己的技术,赚钱的方式还是有很多种的。仅仅靠在公司出卖自己的劳动时...

女程序员,为什么比男程序员少???

昨天看到一档综艺节目,讨论了两个话题:(1)中国学生的数学成绩,平均下来看,会比国外好?为什么?(2)男生的数学成绩,平均下来看,会比女生好?为什么?同时,我又联想到了一个技术圈经常讨...

85后蒋凡:28岁实现财务自由、34岁成为阿里万亿电商帝国双掌门,他的人生底层逻辑是什么?...

蒋凡是何许人也? 2017年12月27日,在入职4年时间里,蒋凡开挂般坐上了淘宝总裁位置。 为此,时任阿里CEO张勇在任命书中力赞: 蒋凡加入阿里,始终保持创业者的冲劲,有敏锐的...

总结了 150 余个神奇网站,你不来瞅瞅吗?

原博客再更新,可能就没了,之后将持续更新本篇博客。

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

新一代神器STM32CubeMonitor介绍、下载、安装和使用教程

关注、星标公众号,不错过精彩内容作者:黄工公众号:strongerHuang最近ST官网悄悄新上线了一款比较强大的工具:STM32CubeMonitor V1.0.0。经过我研究和使用之...

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

大学一路走来,学习互联网全靠这几个网站,最终拿下了一把offer

大佬原来都是这样炼成的

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

为什么你不想学习?只想玩?人是如何一步一步废掉的

不知道是不是只有我这样子,还是你们也有过类似的经历。 上学的时候总有很多光辉历史,学年名列前茅,或者单科目大佬,但是虽然慢慢地长大了,你开始懈怠了,开始废掉了。。。 什么?你说不知道具体的情况是怎么样的? 我来告诉你: 你常常潜意识里或者心理觉得,自己真正的生活或者奋斗还没有开始。总是幻想着自己还拥有大把时间,还有无限的可能,自己还能逆风翻盘,只不是自己还没开始罢了,自己以后肯定会变得特别厉害...

什么时候跳槽,为什么离职,你想好了么?

都是出来打工的,多为自己着想

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

你期望月薪4万,出门右拐,不送,这几个点,你也就是个初级的水平

先来看几个问题通过注解的方式注入依赖对象,介绍一下你知道的几种方式@Autowired和@Resource有何区别说一下@Autowired查找候选者的...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

《经典算法案例》01-08:如何使用质数设计扫雷(Minesweeper)游戏

我们都玩过Windows操作系统中的经典游戏扫雷(Minesweeper),如果把质数当作一颗雷,那么,表格中红色的数字哪些是雷(质数)?您能找出多少个呢?文中用列表的方式罗列了10000以内的自然数、质数(素数),6的倍数等,方便大家观察质数的分布规律及特性,以便对算法求解有指导意义。另外,判断质数是初学算法,理解算法重要性的一个非常好的案例。

立即提问
相关内容推荐