Ubuntu uses MySQL Workbench to connect to remote cloud server MySQL
A summary of the steps to connect to a remote cloud server MySQL using MySQL Workbench under Ubuntu .
1.Create a new user
Generally for security, we do not directly use the root user, but choose to create a new user.
In the server, enter mysql -u root -p, enter mysql,
Then enter the following command to create a user
GRANT ALL ON *.* to user@'ip' IDENTIFIED BY'pwd';
The knowledge about permissions is not mentioned here,
user is the username you want to create
ip is the access address,% represents remote access, localhost is local access, or it can be specific to a certain ip address, we will use% here
pwd is the password you want to create
The user created above is a user with all permissions, which can be understood as an administrator second only to the root user.
After creation, you can refresh the permission table
FLUSH PRIVILEGES;
It's okay not to refresh, because we can restart mysql.
sudo /etc/init.d/mysql restart
2.Turn on remote access
Because mysql closes remote access by default, we need to change it.
sudo vim /etc/mysql/mysql.conf.d/mysqld.conf
This configuration file is our ubuntu, including modifying the character set is also changed in this file. Modify character set
We find bind-address = 127.0.0.1 in this file
Then comment it out
# By default we only accept connections from localhost
# The official translation is that by default, we only accept connections from the local host
# bind-address = 127.0.0.1
3.Use MySQL WorkBench
Then you can!
Linux (Ubuntu) system mysql-5.7 modify character set
Cause: When I read articles about modifying mysql characters on the Internet, I always said to configure the /etc/mysql/my.cnf file
However, when I opened the my.cnf file mentioned above, I found that the content inside was different from others.I felt that this is definitely not the correct file.
After my research on the official website, I found the real file
it is this
/etc/mysql/mysql.conf.d/mysqld.cnf
At least this is both on my local computer and cloud server, or in other words, the mysql database installed according to my blog post is the above file
Then we edit the above file, find [mysqld] and add it below:
character-set-server =utf8
Then restart the service
sudo /etc/init.d/mysql restart
Log in to mysql again to view
msql> show variables like'character%';
It's ok.
0 Comments