Mysql authorizes the root account to remotely access, import SQL files, and log on to mysql with the root account

Source: Internet
Author: User
After the installation is complete, MySQL uses a blank password by default. You can set a password for the root user. Note the case sensitivity: mysqlSETPASSWORDFORroot @ localhostPASSWORD (admin ); log on to mysql and use the root account $ mysql -- userroot -- passwordrootmysql to authorize the root account to remotely access mysqlgrantallpriv

After the installation is complete, MySQL uses a blank PASSWORD by default. You can SET a password for the root user. Note that the case sensitivity is mysql set password for root @ 'localhost' = PASSWORD ('admin '); // log on to mysql using the root account $ mysql -- user = root -- password = root mysql // authorize the root account to remotely access mysqlgrant all priv

After the installation is complete, MySQL uses a blank password by default. You can set a password for the root user. Note the case sensitivity.
Mysql> set password for root @ 'localhost' = PASSWORD ('admin ');

// Log on to the mysql root Account
$> Mysql -- user = root -- password = root mysql

// Authorize the root account for remote access
Mysql> grant all privileges on *. * to 'root' @ '% 'identified by 'root ';

// Delete the database
Drop database test;
Create a database
Create dababase test;


// Import the SQL File
# Creating a database
Create database jeecms_2012;
Source/home/zhangshibo/jeecms. SQL;

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.