Study Linux notes (5)-Mysql Application
Check whether mysql is installed:
# Rpm-qa mysql;
If the installation has been completed, delete the command:
# Rpm-e -- nodeps mysql (-- nodeps is forcibly deleted)
Also, use the command line to back up and restore the database: Backup:
# Mysqldump-u root-p Password Database Name> data. bak (Table: zebra. users)
Recovery:
# Mysql-u root-p Password Database Name <data. bak
Here, we usually assign a group to mysql for management, with high security.
# Groupadd mysql
# Useradd-g mysql
Go to the mysql folder to start installation:
# Scripts/mysql_install_db -- user = mysql (initialize the database)
# Chown-R root. (. Is the current folder, modifying the file owner)
# Chown-R mysql data. (modify the owner of the data folder and manage the database to mysql)
# Chgrp-R mysql. (Change User Group)
Start mysql: # bin/mysql_safe -- user = mysql &
Modify the configuration and direct the path to the mysql execution directory. You can access mysql in any directory:
# Cd/root /. bash_profile is added to the bin file:/home/mysql/bin (the mysql installation directory), and # env is used to check whether the mysql path exists in the configuration bin, then we can test it. Ubantu systems are slightly different, with the same logic, but google.
Test the mysql project. Note that the mysql driver jar package is stored in the/jdk/lib/ext/directory.