Download MySQL-8.0.23 Unzip the MySQL installation package to a directory (here I choose: /usr/local) sudo tar -Jxv -f /home/×××shanlin/Downloads/mysql-8.0.23-linux-glibc2.12-x86_64.tar.xz -C /usr/local/ Note: /home/×××shanlin/Downloads/ is the directory where my browser saves files Create a soft link (easy to operate: you can think of it as giving the mysql-8.0.23-linux-glibc2.12-x86_64 directory an alias called mysql) sudo ln -s /usr/local/mysql-8.0.23-linux-glibc2.12-x86_64 mysql Create a directory to store MySQL data (/data/mysql/data) and generate the database connection file mysql.sock (/var/run/mysqld) sudo mkdir -p /data/mysql/data sudo mkdir -p /var/run/mysqld Create mysql user group and user sudo groupadd mysql sudo useradd -r -g mysql mysql Grant permissions to the /data/mysql/data and /var/run/mysqld directories sudo chown mysql:mysql -R /data/mysql/data sudo chown mysql:mysql -R /var/run/mysqld Create a my.cnf file and use the which mysqld command to view the location of mysqld: mine is /usr/local/mysql/bin/mysqld, then use the /usr/local/mysql/bin/mysqld --verbose --help |grep -A 1 'Default options' command to view the location where my.cnf can be created: [mysqld] bind-address=0.0.0.0 port=3306 user=mysql basedir=/usr/local/mysql datadir=/data/mysql/data socket=/var/run/mysqld/mysqld.sock log-error=/data/mysql/data/mysql.err pid-file=/data/mysql/data/mysql.pid character_set_server=utf8mb4 symbolic-links=0 explicit_defaults_for_timestamp=true default_authentication_plugin=mysql_native_password #Solve the error Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) [client] port=3306 socket=/var/run/mysqld/mysqld.sock #Create my.cnf directly with vim and write the above content sudo vim /usr/local/mysql/my.cnf Configure MySQL environment variables #mysql MYSQL_HOME=/usr/local/mysql PATH=$PATH:$MYSQL_HOME/bin export PATH MYSQL_HOME #Write the above content at the end of the profile file sudo vim /etc/profile #Environment variables take effect immediately sudo source /etc/profile Install MySQL sudo /usr/local/mysql/bin/mysqld --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql/data --initialize After normal installation, it will finally display: Start MySQL service sudo /usr/local/mysql/support-files/mysql.server start Put the MySQL process into the system process sudo cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld Create a soft link to MySQL in /usr/bin sudo ln -s /usr/local/mysql/bin/mysql /usr/bin Log in to MySQL database using a random password mysql -u root -p Set a new password for the root user alter user 'root'@'localhost' identified by '123456'; This is the end of this article about installing MySQL 8.0.23 on deepin 20.1 system (the most domestically produced Liunx system, the most detailed MySQL 8 installation tutorial). For more relevant content about installing MySQL 8.0.23 on deepin 20.1 system, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: How to deploy Rancher with Docker (no pitfalls)
>>: Share CSS writing standards and order [recommended for everyone to use]
1. Color matching problem <br />A web page s...
Table of contents The principle and function of l...
Table of contents What is a web container? The Na...
As the title says: The height is known, the width...
The following is an introduction to using SQL que...
1. Key points for early planning of VMware vSpher...
Table of contents 1. Concept 2. Environmental Des...
theme Today I will teach you how to create a circ...
Table of contents 1. Shared and Exclusive Locks 2...
There are two files a.htm and b.htm. In the same d...
This article records the installation and configu...
IE has had problems for a long time. When everyone...
Preface In the early stages of some projects, dev...
Table of contents 1. Proxy in LAN 2. Intranet pen...
This article example shares the specific code of ...