1. 查看我的linux版本
lsb_release -a
2. 安裝mysql server
sudo apt-get update
sudo apt-get install mysql-server
sudo apt-get install mysql-client
3. 安裝完成后,查看3306端口是否正常
netstat -an | grep 3306
4.?修改Mysql配置文件坷备,注意安裝路徑
vim /etc/mysql/mysql.conf.d/mysqld.cnf
找到
bind-address = 127.0.0.1
并注釋
wq
保存并退出
5.?重啟Mysql
/etc/init.d/mysql restart
6.?啟動完成后蚓耽,查看3306端口是否正常
netstat -an | grep 3306
7. 修改用戶權(quán)限
mysql -uroot -p
#修改密碼
set password for root@localhost = password('123');?
use mysql;
update user set Host = '%' where User='root';
flush privileges;? ?#刷新一下
8. 本地工具連接
9. 卸載
sudo apt-get remove mysql-*
dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P
解決1251 client does not support ...問題
1.查看用戶信息
select host,user,plugin,authentication_string from mysql.user;
備注:host為 % 表示不限制ip??? localhost表示本機使用??? plugin非mysql_native_password 則需要修改密碼
2.修改用戶密碼
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123456';
更新user為root,host為% 的密碼為123456