Install MYSQL commands in LINUX
1. download installation package wget http://cdn.mysql.com/archives/mysql-5.6/mysql-5.6.26-linux-glibc2.5-x86_64.tar.gz 2. unzip the installation package tar zxvf http://cdn.mysql.com/archives/mysql-5.6/mysql-5.6.26-linux-glibc2.5-x86_64.tar.gz 3. enter the folder cd mysql-5.6.26-linux-glibc2.5-x86_64 4. create a user group and user groupadd mysqluseradd-r-g mysql 5. modify the permission chown-R mysql: mysql. /6. install the database. /script/mysql_install_db-user = mysql 7. modify chown-R root: root. /chowd-R mysql: mysql data 8. add mysql as the system service cp support-files/mysql. server/etc/init. d/mysql 9. modify mysql service path configuration vi/etc/init. d/mysql modify basedir = mysql installation package path, datadir = mysql data storage directory (default: mysql installation package path/data) 10. copy the configuration mysql configuration file first check whether there is a mysql-medium.cnf file under the support-files directory, if there is a copy directly it would be good cp support-files/mysql-medium.cnf my. configure cnf 11 if not. add the mysql System variable vi/etc/profile // edit the file. Modify PATH = $ PATH: MYSQL installation package PATH/bin // press the letter I to enter the editing mode. Run esc to exit the editing mode: x save and exit source/etc/profile // make the file take effect echo $ PATH // check whether the file is successfully added 12. start mysqlservice mysql start 13. command Line Connection MYSQLmysql-u root-p // no password for new installation by default. Enter the password and press Enter. SQL basic statement show databases; // view the names of all currently created DATABASES; // CREATE a database use database name; // select the database source SQL file path; // import data grant all privileges on Database Name. * TO username @ "%" identified by 'Password' with grant option; // create a remote user so that he has all permissions for a database