一、卸载mysql:
1、查找以前是否装有mysql
#rpm -qa|grep -i mysql
2、卸载mysql
#yum remove mysql
3、删除相关的包
#yum remove 包名
二、安装mysql:
http://dev.mysql.com/downloads/mysql/
安装mysql服务器端:
rpm ivh MySQL-server-5.6.11-2.el6.i686.rpm
安装mysql客户端:
rpm ivh MySQL-client-5.6.11-2.el6.i686.rpm
1、安装
#rpm -ivh MySQL-server-5.6.11-2.el6.i686.rpm
#rpm -ivh MySQL-client-5.6.11-2.el6.i686.rpm
2、检查MySQL服务是否开启:
#netstat -nat
如果开启的话,会有一个端口号为3306,如果没有启动的话,运用service mysql start启动mysql服务
3、登录及相关问题解决办法
#mysql -uroot -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)该错解决方法
#service mysql stop
#mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
#mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD('root') where USER='root';
mysql> FLUSH PRIVILEGES;
mysql> quit
#service mysql start
如果想需要添加一个可以具有原创访问的mysql账号(需要进入mysql命令行下):
GRANT ALL PRIVILEGES ON *.* TO test@"%" IDENTIFIED BY "123456" WITH GRANT OPTION;
如果MySql5.6操作时报错:You must SET PASSWORD before executing this statement解决,执行下面一句话
mysql> SET PASSWORD = PASSWORD('root');