Home >Database >Mysql Tutorial >What is the method to uninstall and install mysql?
1. Uninstall MySQL under Windows system
Open "Computer" - "Control Panel" - "Programs" - "Programs and Features" " option.
Find the MySQL program, click on it, and select the "Uninstall" option.
MySQL configuration files and data files can be deleted in the pop-up uninstall window. If you wish to reinstall MySQL, you can keep these files.
After the uninstallation is complete, please open the MySQL installation path in the file browser and manually delete other related files and folders. C:\Program Files\MySQL and the subdirectories it contains can be deleted if MySQL is installed under this path.
2. Installation of MySQL under Windows system
First, download the MySQL installation program suitable for your system version from the MySQL official website.
Double-click the downloaded installation program and follow the prompts to complete the MySQL installation process.
During the installation process, you can choose to set the MySQL port number, installation path, root user password and other information.
After the installation is complete, open the Windows service list and you will find that the MySQL service is already running. If the MySQL service is not started, you can start it manually.
You can find the command line tool mysql.exe by searching in the MySQL installation path. MySQL databases can be created, managed and maintained using mysql.exe.
3. Uninstall MySQL under Linux system
Open the Linux terminal and use the following command to uninstall MySQL: sudo apt-get remove mysql-server
When uninstalling MySQL, the system will automatically ask whether to delete the MySQL configuration file. Choose whether to delete it based on your own situation.
After uninstallation is complete, use the following command to delete the MySQL data directory: sudo rm -rf /var/lib/mysql/
Deletion process , please make sure you back up important files in the MySQL data directory.
4. Installation of MySQL under Linux system
In Linux system, the version and installation method of MySQL may be different. The following are simple steps to install MySQL in Ubuntu system:
Open a Linux terminal and use the following command to install MySQL: sudo apt-get install mysql-server
During the installation process, the system will ask you to set the root password of MySQL. Please keep it properly.
After the installation is complete, use the following command to check whether the MySQL service is running: systemctl status mysql
To enter the command line mode of MySQL, just enter Enter the "mysql" command in the terminal. SQL statements can be used to create, manage and maintain MySQL databases.
The above is the detailed content of What is the method to uninstall and install mysql?. For more information, please follow other related articles on the PHP Chinese website!