MySQL is the Linux platform's most popular database system, today is the introduction of MySQL installation and simple operation Method!
Groupadd MySQL//set up MySQL user group
useradd-g mysql mysql//MySQL account set up
TAR-ZXVF mysql-x.x.xx.tar.gz//unzip MySQL
CD mysql-5.0.45//into the extracted MySQL directory
./configure–prefix=/usr/local/mysql–with-charset=utf8–with-collation=utf8_general_ci–with-extra-charsets= Latin1//Set parameters
Make
Make install//start installation
CP support-files/my-medium.cnf/etc/my.cnf//copy my-medium.cnf files to/etc/directory and rename to My.cnf
Open the my.cnf file with the editor, find the Log-bin=mysql-bin line, and comment it out
: #log-bin=mysql-bin
Cd/usr/local/mysql//Enter MySQL directory
bin/mysql_install_db--user=mysql
Chown-r Root. Set Directory Permissions Properties
Chown-r Mysql/usr/local/mysql/var
Chgrp-r MySQL
Bin/mysqld_safe--user=mysql &/Start MySQL
Open the/etc/rc.local file with the editor, plus/usr/local/mysql/bin/mysqld_safe–user=mysql & in front of exit 0
Reboot, enter MySQL, if you can enter the start success!
——————————-MySQL Common commands ————————
Mysql-uroot-p//Login native MySQL, root for user name
Mysqladmin-uroot-p password 1234//1234 for new password
Create DATABASE MyDB; Create a new database named MyDB
Drop DB mydb//delete a database named MyDB
Show databases//view database
DESC func//view detail structure of datasheet
————————— – Critical, common database maintenance operations ————
Mysqldump-uroot-p-all-database>/users/venmos/backup.sql//backup of all databases to backup.sql files in/users/venmos/directory
Mysqldump-uroot-p mydb>/users/venmos/backup.sql//Backup MyDB database to backup.sql file in/users/venmos/directory
Use/users/venmos/backup.sql//import of the Backup.sql database for the/users/venmos/directory
The above is about the installation of MySQL and simple operation method, hope for everyone useful!