Install MYSQL commands in LINUX

Source: Internet
Author: User
Tags mysql commands

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.