To query whether MySQL is installed:
#rpm-qa MySQL;
If you have already installed, delete the command:
#rpm-e--nodeps MySQL (--nodeps is forced to delete)
There is also the command line for database backup and recovery:Backup:
#mysqldump-u root-p password database name >data.bak (table is zebra.users)
Recovery:
#mysql-u root-p password database name <data.bak
Here, in general, we will assign a group to MySQL to manage, security highs.
#groupadd MySQL
#useradd-G MySQL MySQL
Go to the MySQL folder to start the installation:
#scripts/mysql_install_db--user=mysql (Initialize database)
#chown-R Root. (. Is the current folder, modify the owner of the file)
#chown-R MySQL data. (Modify the owner of the Data folder to give the database management to MySQL)
#chgrp-R MySQL. (change user group)
Start MySQL: #bin/mysql_safe--user=mysql &
Modify the configuration, point the path to the MySQL execution directory, and the implementation can enter MySQL in any directory:
#cd/root/.bash_profile in this file add:/home/mysql/bin (is the MySQL installation directory), and finally use #env to see if there is a MySQL path in the configuration bin, then it can be tested. Ubantu system slightly different, the same logic, but Google.
To test the MySQL project, note that the MySQL driver jar package is placed in the/jdk/lib/ext/directory.
Learn Linux notes (v)-mysql application