MySQL installation-free production instructions

Source: Internet
Author: User
Tags mysql host

1> extract the compressed file mysql-noinstall-5.1.6-alpha-win32.zip to a directory, set mysql_home in the environment variable, and add % mysql_home % \ bin to path.

2> Create my. ini configuration file, content: [mysqld] # Set basedir to MySQL installation path basedir =... \ mysqldatadir =... \ mysql \ data my. the INI file is placed under the system file.

3> Start and Stop mysqlmysqld.exe --install(install Windows Service, uninstall and use mysqld.exe -- remove) Start: Net start MySQL stop: net stop MySQL

4> MySQL connection format: mysql-H host address-u user name-P User Password Example 1: connect to mysqlmysql-uroot-P on the local machine Example 2: connect to mysqlmysql-h110.110.110.110-uroot-pabcd123 on the remote host

5> exit MySQL Command exit (Press ENTER) or quit (Press ENTER)

6> Change Password format: mysqladmin-u username-P old Password new password example: Add a password ab12 to the root user. First, enter the directory mysqlbin in DOS, and then type the following command mysqladmin-uroot password ab12. Note: because the root has no password at the beginning, the old-P password can be omitted. 2. Example 2: Change the root password to djg345. Mysqladmin-uroot-pab12 password djg345 contains commands in the MySQL environment, ending with a semicolon

7> added the new user format: grant select on database. * To username @ login host identified by "password"; Example 1: Add a user test1 whose password is ABC so that he can log on to any host, all databases are permitted to query, insert, modify, and delete databases. First, use the root user to connect to MySQL, and then type the following command: grant select, insert, update, delete on *. * To test1 @ "%" identified by "ABC"; Example 2: Add a user named "Test2" with the password "ABC" so that the user can only log on to localhost, you can also query, insert, modify, and delete the database mydb (localhost refers to the local host, that is, the host where the MySQL database is located), so that the user knows the password of Test2, you cannot access the database directly from the Internet. You can only access the database through the web pages on the MySQL host. Grant select, insert, update, delete on mydb. * To Test2 @ localhost identified by "ABC ";

8> display the Database List show databases;

9> display the data table use MySQL in the database; // The database name show tables;

10> display the describe Table Name of the data table structure;

11> Create Database database name;

12> Create Table Use Database Name; Create Table Name (......

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.