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]
To debug js code, you need to write debugger in t...
Nginx Rewrite usage scenarios 1. URL address jump...
A hyperlink URL in Vm needs to be concatenated wit...
Preface In the process of writing code, we will i...
I have been engaged in Java web development for mo...
1. Environment and preparation 1. Ubuntu 14.04 2....
The previous article on Docker mentioned the cons...
This article records the detailed tutorial of MyS...
Web design, according to personal preferences and ...
Does color influence website visitors? A few year...
This article shares the specific code of Vue+expr...
First, perform a simple Docker installation. To c...
1. Current date select DATE_SUB(curdate(),INTERVA...
The following is some basic sql knowledge I have ...
Table of contents Explanation of v-text on if for...