问题1 ,安装的时候,提示错误,原因,OS是Min安装,需要安装numactl包
-- server log begin --
/mysql/mysql/bin/mysqld: error while loading shared libraries: libnuma.so.1: cannot open shared object file: No such file or directory
问题2 ,原因,需要创建mysql用户
2019-04-18T02:22:30.796541Z 0 [ERROR] Fatal error: Can't change to run as user 'mysql' ; Please check that the user exists!
问题3 ,这个先不用管 ,在5.6的时候,不出现这个问题,在5.7出现这个问题。5.7建议使用初始化,而不是5.6的db_install脚本
2019-04-18 10:23:59 [WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize
2019-04-18 10:24:03 [WARNING] The bootstrap log isn't empty:
2019-04-18 10:24:03 [WARNING] 2019-04-18T02:23:59.493413Z 0 [Warning] --bootstrap is deprecated. Please consider using --initialize instead
2019-04-18T02:23:59.494078Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
2019-04-18T02:23:59.494085Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
问题4 ,设置mysql服务后,可以关闭,发现无法启动,原因,在/etc/下有my.cnf,删除或者重命名即可
[root@mysql1 init.d]# service mysql start
Starting MySQL.2019-04-18T06:04:51.569263Z mysqld_safe Directory '/var/lib/mysql' for UNIX socket file don't exists.ERROR! The server quit without updating PID file (/mysql/mysql/data/mysql1.pid).
[root@mysql1 init.d]# service mysql statusERROR! MySQL is not running, but lock file (/var/lock/subsys/mysql) exists
问题5 ,原因,要设置下密码
mysql> show databases;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.mysql> alter user user() identified by 'mysql';
Query OK, 0 rows affected (0.00 sec)
问题6 ,没有开通GTID,开通就可以了。
ERROR 1777 (HY000): CHANGE MASTER TO MASTER_AUTO_POSITION = 1 cannot be executed because @@GLOBAL.GTID_MODE = OFF.
问题7 ,原因同上面,需要开通GTID。
mysql> change master to master_host='192.168.54.230',master_user='rep1',master_password='mysql',master_log_file='master-bin.000002',master_log_pos=1029;
Query OK, 0 rows affected, 2 warnings (0.03 sec)mysql> show warning;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'warning' at line 1
mysql> show warnings;
+-------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+
| Level | Code | Message |
+-------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+
| Error | 1064 | You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'warning' at line 1 |
+-------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
-- 2019-04-30 add
坑8 ,原因,不需要逗号,去掉逗号就可以了。(测试用,所以这里没有加那个trancasction参数,会锁表)
[root@test ~]# mysqldump -uroot -p --socket=/tmp/mysql3306.sock --databases acdm,tes,test,tes_db,zoo > /mysql/mysql/dump20190430.sql
Enter password:
mysqldump: Got error: 1049: Unknown database 'acdm,tes,test,tes_db,zoo' when selecting the database
坑9 ,启动mysql服务的时候,提示没有updating pidfile。 原因,my.cnf里面设置socket文件为/tmp/mysql3306.sock即可,原来设置的是/mysql/mysql3306.sock
[root@redhat762100 init.d]# service mysql3306 start
Starting MySQL... ERROR! The server quit without updating PID file (/mysql/mysql3306/data/redhat762100.pid).
END