The installation of a .Mysql
1. Install mysql service and client
apt install mysql-server
sudo apt install mysql-client
sudo apt install libmysqlclient-dev
2. Test whether the installation was successful:
sudo netstat -tap | grep mysql
3. Set the mysql allow remote access:
vim /etc/mysql/mysql.conf.d/mysqld.cnf
Comment out bind-address = 127.0.0.1:
4. Go to the mysql client:
mysql-uroot-p
5. execute privileged commands, refresh the configuration information:
GRANT ALL PRIVILEGES ON *.* TO
'root'
@
'%'
IDENTIFIED BY
'你的密码'
WITH GRANT OPTION;
flush privileges;
Second command parsing:
1. Client
Client Installation mysql:
apt install mysql-client
Our help documentation:
mysql --help
Connect to mysql
mysql -uroot -p
drop out:
exit
2. User Management
Create a user: create usr 'username' @ 'IP address' identified by 'password';
Delete User: drop user 'username' @ 'IP address';
Modify the user: rename user 'username' @ 'IP address'; to 'new user name' @ 'IP address';
Change Password: set password for 'username' @ 'IP address' = Password ( 'new password')
3. Rights Management (default, no permissions)
Authorization: grant permission on the database table to 'user' @ 'IP address'.
Cancellation rights:. Revoke privileges on database tables from 'user' @ 'IP address'
View permissions: show grants for 'user' @ 'IP address'
IP segment supports wildcards:%: If 192.168.60%.