Mysql安装
CentOS下安装Mysql方法
下载server和client
下载server和client,将其上传到服务器。
- MySQL-server-5.6.31-1.rhel5.x86_64.rpm
- MySQL-client-5.6.31-1.rhel5.x86_64.rpm
进行安装
执行命令进行安装
1 |
|
设置开机启动mysql
查看是否开机启动
1
chkconfig --list | grep mysqld
1
chkconfig --list | grep mysql
1
chkconfig mysqld on
1
2chkconfig mysql on
chkconfig --list | grep mysqld
1 |
|
进入Mysql
1 |
|
报错处理
出现如下报错的应对措施:
1、error: 'Access denied for user 'root'@'localhost' (using password: YES)' 或者error: 'Access denied for user 'root'@'localhost' (using password: NO)'
方法一: 1
2
3
4
5
6
7
8
9
10# /etc/init.d/mysql stop
# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
# mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root';
mysql> FLUSH PRIVILEGES;
mysql> quit
# /etc/init.d/mysqld restart
# mysql -uroot -p
Enter password: <输入新设的密码newpassword>
mysql>1
2
3
4
5
6
7
8
9
10# mysql -udebian-sys-maint -p
Enter password: <输入[client]节的密码>
mysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root';
mysql> FLUSH PRIVILEGES;
mysql> quit
# mysql -uroot -p
Enter password: <输入新设的密码newpassword>
mysql>
1 |
|
2、ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
1 |
|
本博客所有文章除特别声明外,均采用 CC BY-SA 4.0 协议 ,转载请注明出处!