In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article introduces you how to install MySQL in Ubuntu18.04, the content is very detailed, interested friends can refer to, hope to be helpful to you.
1. Install MySQL
In Ubuntu, by default, only the latest version of MySQL is included in the APT package repository, and to install it, simply update the package index on the server and install the default package apt-get.
# Command 1sudo apt-get update# Command 2sudo apt-get install mysql-server
two。 Configure MySQL2.1 initialization configure sudo mysql_secure_installation
There are many configuration items, as follows:
# 1VALIDATE PASSWORD PLUGIN can be used to test passwords...Press y | Y for Yes, any other key for No: n (my option) # 2Please set the password for root here...New password: (enter password) Re-enter new password: (re-enter) # 3By default, a MySQL installation has an anonymous user,allowing anyone to log into MySQL without having to havea user account created for them...Remove anonymous users? (Press y | Y for Yes, any other key for No): n (my option) # 4Normally, root should only be allowed to connect from'localhost'. This ensures that someone cannot guess atthe root password from the network...Disallow root login remotely? (Press y | Y for Yes, any other key for No): y (my option) # 5By default, MySQL comes with a database named 'test' thatanyone can access...Remove test database and access to it? (Press y | Y for Yes, any other key for No): n (my option) # 6Reloading the privilege tables will ensure that all changesmade so far will take effect immediately.Reload privilege tables now? (Press y | Y for Yes, any other key for No): y (my option) 2.2 check mysql service status systemctl status mysql.service
The following results show that the mysql service is normal:
3. Configure remote access
Under Ubuntu, MySQL only allows local access by default, and it is impossible to connect using the workbench connection tool.
If you want other machines to be accessible, you need to configure it.
3.1 first enter sudo mysql-uroot-p with the root user
Log in to root to make other settings:
GRANT ALL PRIVILEGES ON *. * TO root@localhost IDENTIFIED BY "123456"
Root@localhos,localhost is the local access, configured to% that all hosts can connect.
The second '123456' is the password you set to the newly authorized user.% represents all hosts, or it can be a specific ip.
However, this is set up%, but I root still can not log in through the tool, probably for security, so create a new database and users
3.2 New databases and users
Create new data with root users and users for remote access
# # 1 create database weixxCREATE DATABASE weixx;##2 create user wxx (password 654321) and allow wxx users to log in to mysql's weixx database GRANT ALL PRIVILEGES ON weixx.* TO wxx@ "%" IDENTIFIED BY "654321" from any machine; 4. Connect to the database using workbench
Open workbench to configure the connection:
After the configuration is complete, select the weixx database in the main interface to connect:
On how to install MySQL in Ubuntu18.04 to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.