连接MySQL 8.0
1.安装MySQL 8.0, 去官网下载安装包
(1) 下载链接:点击打开链接 https://dev.mysql.com/downloads/mysql/;
(2) 安装步骤详见:[https://blog.csdn.net/github_39533414/article/details/80144890]
2.给启动MySQL
(1)进入MySQL数据库 mysql -u root -p 输入密码:
(2)启动MySQL :
service mysqld start
chkconfig mysqld on
mysqladmin -u root passwd linuxprobe ;
(3)查看端口号是否开启:
lsof -i:3306
netstat -tnulp |grep 3306;
如端口没有启动, 则添加3306端口:
iptables -I INPUT 1 -p tcp --dport 3306 -j ACCEPT;
3.给MySQL数据库添加用户:
(1)查看数据库下所有用户:
>mysql select user,host from mysql.user;![代码图](https://img-blog.csdn.net/2018073014211826?watermark/2/text/aHR0cHM6Ly9ibG9nL