ChatGPT answer: linux offline installation mysql steps

The steps to install MySQL offline on Linux are as follows:

1. Download the MySQL tar package (for example: mysql-5.7.20.tar.gz) to the local directory, assuming that the package has been downloaded to the /opt directory.

2. Decompress the MySQL tar package and execute the following command: sudo tar -zxvf mysql-5.7.20.tar.gz

3. Switch to the decompressed directory, execute the following command to compile and install MySQL: cd mysql-5.7.20 sudo cmake . sudo make && sudo make install

4. Start the MySQL database service: sudo mysqld_safe --user=mysql &

5. Then we can log in to mysql through the following command: sudo mysql -uroot -p

6. After the mysql installation is complete, you need to set the password of the root user: ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password'; where 'password' is the password of the root user.

During the installation process, there may be some library-dependent problems, which need to be resolved according to the specific situation.

        sudo is a command in Linux and Unix systems that allows ordinary users to execute commands as superuser or other users. Usually, in order to ensure system security, only administrators or superusers in Linux systems can perform some system-level operations, such as installing software and modifying system configurations. The sudo command allows ordinary users to perform some necessary operations as an administrator or super user through temporary authorization, and also prevents users from abusing root privileges to cause damage to the system. Therefore, the sudo command is often used in the management and maintenance of Linux systems.

Guess you like

Origin blog.csdn.net/zhenghaochang/article/details/130018361