1. First enter the linux connection database and enter the password:
1
|
mysql -uroot -p
|
2. Enter the following command to authorize:
1
|
GRANT ALL PRIVILEGES ON *.* TO
'root'
@
'%'
IDENTIFIED BY
'这里写自己数据库的密码'
WITH GRANT OPTION;
|
3. Refresh permissions:
FLUSH
PRIVILEGES;
|
4. But after adding permissions, it still can't connect to the database. You must add port 3306 to the server's security group
FLUSH
PRIVILEGES;
|