linux-mysql


5.7
******************************************************************************
//ubuntu16 默认安装 mysql 5.7
sudo apt install mysql-server
******************************************************************************
//% remote
mysql -uroot -p
mysql> use mysql;
mysql> select host,user from user;
+-----------+------------------+
| host | user |
+-----------+------------------+
| localhost | debian-sys-maint |
| localhost | mysql.session |
| localhost | mysql.sys |
| localhost | root |
+-----------+------------------+
4 rows in set (0.00 sec)
mysql> create user 'remote'@'%' identified with mysql_native_password by 'ABCabc123456789';
Query OK, 0 rows affected (0.01 sec)
mysql> grant all privileges on *.* to 'remote'@'%';
Query OK, 0 rows affected (0.00 sec)
mysql> show grants for 'remote'@'%';
mysql> select host,user from user;
+-----------+------------------+
| host | user |
+-----------+------------------+
| % | remote |
| localhost | debian-sys-maint |
| localhost | mysql.session |
| localhost | mysql.sys |
| localhost | root |
+-----------+------------------+
5 rows in set (0.00 sec)
mysql> exit
Bye
******************************************************************************
//不绑定127.0.0.1
# cat /etc/mysql/my.cnf
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/
# vim /etc/mysql/mysql.conf.d/mysqld.cnf
# bind-address = 127.0.0.1 //注释该行
******************************************************************************
//重启

8.0 apt
******************************************************************************
wget https://repo.mysql.com//mysql-apt-config_0.8.10-1_all.deb
sudo dpkg -i mysql-apt-config_0.8.10-1_all.deb
sudo apt update
sudo apt install mysql-server
//use legacy authentication method (retain mysql 5.x compatibility)
******************************************************************************
mysql -uroot -p
mysql> create user 'remote'@'%' identified with mysql_native_password by 'ABCabc123456789';
Query OK, 0 rows affected (0.01 sec)
mysql> grant all privileges on *.* to 'remote'@'%';
mysql> show grants for 'remote'@'%';
//重启

8.0 二进制包
******************************************************************************

8.0 源码
******************************************************************************

猜你喜欢

转载自www.cnblogs.com/dailycode/p/9384086.html