This article records the installation and configuration graphic tutorial of Linux MySQL 8.0.18 for your reference. The specific contents are as follows 1. Official website installation package download address 2. I upload the installation package to the Linux server via xftp 3. Unzip Decompression command: tar -xvf mysql-8.0.18-linux-glibc2.12-x86_64.tar Continue to unzip the one you need Command: tar -xvf mysql-8.0.18-linux-glibc2.12-x86_64.tar.xz Rename and move to the appropriate directory Rename: mv mysql-8.0.18-linux-glibc2.12-x86_64 mysql move: 4. Create a data folder under /usr/local/mysql # mkdir data 5. Initialize the database and automatically generate a password that needs to be recorded for later use # bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data ps: I encountered a pit in the middle and reported an error when initializing the database The specific error is: bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory The solution is: yum install libaio-devel.x86_64 The reason is that libaio is missing. Just install it. Execute the initialization command again Get the initialization password, you need to write it down, you will need it later 6. Modify the user of the current directory /usr/local/mysql # chown -R root:root ./ # chown -R mysql:mysql data 7. Copy the my-default.cnf file to etc/my.cnf The specific commands are: # cd support-files/ # touch my-default.cnf # chmod 777 ./my-default.cnf # cd ../ # cp support-files/my-default.cnf /etc/my.cnf 8. After finishing, configure my.cnf vim /etc/my.cnf content: [mysqld] # Remove leading # and set to the amount of RAM for the most important data # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%. # innodb_buffer_pool_size = 128M # Remove leading # to turn on a very important data integrity option: logging # changes to the binary log between backups. # log_bin # These are commonly set, remove the # and set as required. basedir = /usr/local/mysql datadir = /usr/local/mysql/data socket = /tmp/mysql.sock log-error = /usr/local/mysql/data/error.log pid-file = /usr/local/mysql/data/mysql.pid tmpdir = /tmp port = 5186 #lower_case_table_names = 1 # server_id = ..... # socket = ..... #lower_case_table_names = 1 max_allowed_packet=32M default-authentication-plugin = mysql_native_password #lower_case_file_system = on #lower_case_table_names = 1 log_bin_trust_function_creators = ON # Remove leading # to set options mainly useful for reporting servers. # The server defaults are faster for transactions and fast SELECTs. # Adjust sizes as needed, experiment to find the optimal values. # join_buffer_size = 128M # sort_buffer_size = 2M # read_rnd_buffer_size = 2M sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES If MySQL reports an error during operation, you can directly view the error log in the log-error = /usr/local/mysql/data/error.log directory Command: cat /usr/local/mysql/data/error.log 9. Start automatically and enter /usr/local/mysql/support-files for settings # cd support-files/ # cp mysql.server /etc/init.d/mysql # chmod +x /etc/init.d/mysql 10. Registration Services # chkconfig --add mysql 11. Check if it is successful 12.etc/ld.so.conf needs to configure the path, otherwise an error will be reported # vim /etc/ld.so.conf Add the following content: /usr/local/mysql/lib 13. Configure environment variables # vim /etc/profile # source /etc/profile Add the following content: #MYSQL ENVIRONMENT export PATH=$PATH:/usr/local/mysql/bin:/usr/local/mysql/lib 14. Login requires the password generated above #Start mysql service [root@localhost bin]# service mysql start Starting MySQL.Logging to '/usr/local/mysql/data/error.log'. ..SUCCESS! [root@localhost bin]# #Change mysql passwordmysql> alter user 'root'@'localhost' identified by '123456'; Query OK, 0 rows affected (0.02 sec) mysql> ps: The second pit, the error details appear at startup: I spent the whole afternoon looking for this error and finally found out that the problem was with the my.cnf file configuration. Don't assume that adding # means it is commented out. I checked it n times and felt that there was nothing wrong, but it just didn't work. I had no choice but to find a my.cnf configuration from another server, copied it, replaced it with a slight modification, and solved the problem. Mission accomplished! You can now use the visual tool to connect to the database. The installation is complete. Wonderful topic sharing: MySQL different versions installation tutorial MySQL 5.7 installation tutorials for various versions MySQL 5.6 installation tutorials for various versions mysql8.0 installation tutorials for various versions The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: How to express relative paths in Linux
>>: JavaScript ECharts Usage Explanation
1. Space rules Whitespace within HTML code is usu...
CHAR and VARCHAR types are similar, differing pri...
1. Introduction to Docker Docker is developed in ...
After configuring VIP, the error message that app...
Table of contents Error message Cause Error demon...
1. To optimize the query, try to avoid full table...
How can I hide the scrollbars while still being a...
When we install and configure the server LNPM env...
Table of contents 1. Implementation process of qu...
History always repeats itself surprisingly well. ...
Table of contents 1. What is virtual dom? 2. Why ...
Table of contents 1. VueRouter 1. Description 2. ...
Table of contents 1. Developer Platform Configura...
Table of contents 1. ACID Characteristics Transac...
Not using lazy loading import Vue from 'vue...