Ubuntu 安装Mysql

305 阅读1分钟

1.输入命令下载Mysql安装包 sudo apt-get install mysql-server mysql-client

image.png

2.安装完成后查看Mysql默认用户名和密码 sudo cat /etc/mysql/debian.cnf

image.png

3.修改root远程登录的ip为%,意思是允许所有的ip远程访问 image.png

4.修改root用户密码 update user set authentication_string='xxxxx' where user='root';

image.png

5.修改完成后换root 用户登录 sudo mysql -uroot -p