Ubuntu 1604 Configuration Installation mysql8.0

Source: Internet
Author: User
Tags flush

Installation steps:

First, installation by Apt method

Description: This approach is fully referenced in the official tutorial https://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/.

Note: The version installed by APT is now the latest version, and now I am installing 5.7.18. After the installation is done this way, the boot-boot is already configured, and the environment variables on the command line are not manually configured.

1. (can omit) Download the official Mysql-apt-config.deb package for apt source settings: https://dev.mysql.com/downloads/repo/apt/

However, I feel that this configuration does not work, but can be configured to install what type of MySQL, and some common tools, etc., these can be manually through the Apt-get way to install the solution.

sudo dpkg-i mysql-apt-config_0.8.6-1_all.deb

After running, the following interface will appear:

Generally only need to default, press the arrow key to select OK enter.

When you are finished, run the update command:

sudo apt-get update

Description: After the official said to do this with this tool, the installation of MySQL is done according to the selection above.

2. Installation

sudo apt-get install Mysql-server

At this point, if you are prompted with insufficient dependencies, as follows:

Then you need to run the following command to resolve the dependency problem

sudo apt-get install-f

When you install MySQL, you will install the software shown below:

When finished, run the sudo apt-get install mysql-server again. If there is no dependency problem, you do not need to use this command.

3, the operation of the installation process:

The installation process prompts you for the login name and password for the database, as follows:

4, after the installation of the operation:

Note: After installation in this manner, the power-on boot has been configured, and the environment variables on the command line are not manually configured.

After installation, the following directory is created:

Database directory:/var/lib/mysql/

Configuration file:/usr/share/mysql (Command and configuration file),/etc/mysql (e.g. my.cnf)

Related commands:/usr/bin (mysqladmin mysqldump and other commands) and/usr/sbin

Startup script:/etc/init.d/mysql (startup script file mysql directory)

Test:

#服务启动后端口查询sudo NETSTAT-ANP | grep MySQL
#服务管理 # start sudo service mysql start# stop sudo service MySQL stop# service status sudo services MySQL status
#连接数据库mysql-H 127.0.0.1-p 3306-uroot-p123456#-h is the port number for the remote ip,-p,-U is the user name,-p is the password
#测试SQLshow databases;

Test everything is OK.

5. Uninstall

#首先使用以下命令删除MySQL服务器: sudo apt-get remove mysql-server# Then, remove any additional software that is automatically installed with the MySQL server: sudo apt-get autoremove# uninstalling other components: sudo Apt-get Remove <<package-name>> #查看从MySQL the list of installed packages for apt repositories: dpkg-l | grep MySQL | grep II


Windows: Locate the My.ini file under the server-side MySQL folder.
Linux:vi/etc/mysql/mysql.conf.d/mysqld.cnf
Modify bind-address=127.0.0.1 to bind-address=0.0.0.0

If this is not found in MySQL 5 My.ini, you can add this line in the section [mysqld]: bind-address = 0.0.0.0
Restart MySQL service, connection successful

Mysql-u root-p

Grant all privileges on * * to ' root ' @ '% ' identified by ' admin888 ' with GRANT option;
ALTER USER ' root ' @ '% ' identified with Mysql_native_password by ' admin888 ';
Flush privileges;
UFW Allow 3306
Service MySQL Restart


ALTER USER ' root ' @ ' localhost ' identified by ' admin888 ' PASSWORD EXPIRE never;
ALTER USER ' root ' @ '% ' identified with Mysql_native_password by ' admin888 ';
ALTER USER ' root ' @ ' localhost ' identified with Mysql_native_password by ' admin888 '
FLUSH privileges;

Access MySQL Slow:
Vi/etc/mysql/mysql.conf.d/mysqld.cnf
in [mysqld]
Added: Skip-name-resolve


MySQL table name is case sensitive
Ref: 72455768
In Windows services, right-click Properties to view the configuration file
C:\ProgramData\MySQL\MySQL Server 5.7\my.ini
[Mysqld]
lower_case_table_names=2

Linux Modify My.conf
[Mysqld]
Lower_case_table_names=0

Ubuntu 1604 Configuration Installation mysql8.0

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.