MySQL initialization steps

Source: Internet
Author: User

The beginner in the MySQL initialization step must be familiar with the problem that PHP cannot connect to the database just now when using MySQL. Now, let's take a look at the work to be done, on the premise that you have added the mysql working directory to the environment variable. The initialization procedure is as follows: Set the password for the root user: [SQL] mysqladmin-u root password 'new-password' Replace "new-password" in the command line with the new password ". Delete anonymous users: [SQL] # mysql-u root-p mysql> use mysql> delete from user where User = ''; mysql> quit when MySQL is installed, it automatically creates two databases. One is the mysql table, which controls the user, host, and DB permissions after the server is put into use. The other is the test database. MySQL's default configuration allows any user to access the system without providing the user name and password. Reload: [SQL] mysqladmin-u root-p reload now, your MySQL can be accessed through PHP Web.

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.