在文章,Centos6.2中mysql的安装与配置中,使用yum的方式安装了mysql 。再次安装的时候跟系统的环境有关系,遇到了不少问题。记录一下。
yum 安装 出错 Error: Protected multilib versions:
file /usr/share/man/man1/mysqlshow.1.gz from install of mysql-5.1.73-8.el6_8.x86_64 conflicts with file from package MySQL-client-5.5.48-1.linux2.6.i386
file /usr/share/man/man1/mysqlslap.1.gz from install of mysql-5.1.73-8.el6_8.x86_64 conflicts with file from package MySQL-client-5.5.48-1.linux2.6.i386
解决方案:rpm -e mysql-server-5.1.73-8.el6_8.x86_64 --nodeps
170721 22:25:03 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
/usr/libexec/mysqld: Table 'mysql.plugin' doesn't exist
170721 22:25:03 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
170721 22:25:03 InnoDB: Initializing buffer pool, size = 8.0M
170721 22:25:03 InnoDB: Completed initialization of buffer pool
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
170721 22:25:03 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
170721 22:25:03 InnoDB: Started; log sequence number 0 1595675
170721 22:25:03 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
170721 22:25:03 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
170721 22:25:24 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
/usr/libexec/mysqld: Table 'mysql.plugin' doesn't exist
170721 22:25:24 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
170721 22:25:24 InnoDB: Initializing buffer pool, size = 8.0M
170721 22:25:24 InnoDB: Completed initialization of buffer pool
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
170721 22:25:24 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
170721 22:25:24 InnoDB: Started; log sequence number 0 1595675
170721 22:25:24 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
170721 22:25:24 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
170721 22:25:37 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
/usr/libexec/mysqld: Table 'mysql.plugin' doesn't exist
170721 22:25:37 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
安装完启动的时候遇到上述问题。
解决方案:rm -rf /var/lib/mysql
登陆mysql
[root@root opt]# mysql -u root password fxq123
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
解决方案:使用mysql -uroot -proot
一旦登录之后,可以修改用户的账号和密码,
查看用户授权表:select user,host,password from mysql.user;
给用户设置密码:update mysql.user set password=PASSWORD('root') where user='root';
flush privileges;