MySQL common operation commands

Source: Internet
Author: User

Recently, I have studied PHP and MySQL development environments, and tested php5foriis6v2.0.exe, a software that has been compared in win2003 + iis6.0 x86os. It mainly includes php5.25 + mysql5.045 + zend3.3a + phpMyAdmin 3.3.0 and other software. For win2008 + iis7.0 x64 bit systems, the most useful software is to go to www.iis.net website to go to PhP
Manager for IIS 7 is very useful.

After the environment is matched, the common MySQL operation commands are summarized as follows:

MySQL System Environment Variables
Variable name mysql_home variable value c: \ PhP5 \ mysql545
Variable name PATH variable value c: \ PhP5 \ mysql545 \ bin;

MySQL common operation commands
-- Convert to MySQL directory
Cd c: \ PhP5 \ mysql545 \ bin

-- Install MySQL service commands
C: \ PhP5 \ mysql545 \ bin> mysqld-NT -- install

-- Delete MySQL service commands
C: \ PhP5 \ mysql545 \ bin> mysqld-NT -- remove

-- Start MySQL service commands
C: \ PhP5 \ mysql545 \ bin> Net start MySQL

-- Log on to the MySQL database
C: \ PhP5 \ mysql545 \ bin> mysql-u root-H localhost-P
Enter Password: Enter the old password of the root user and press Enter.

-- Change the root user password to the new password.
C: \ PhP5 \ mysql545 \ bin> mysqladmin-u root-P password New Password
Enter Password: Enter the old password of the root user.

-- Test logon to MySQL database with a new password
C: \ PhP5 \ mysql545 \ bin> mysql-u root-H localhost-P
Enter Password: Enter the new password of the root user.

-- Create a database
Mysql> Create Database database name;
Query OK, 1 row affected (0.03 Sec)

-- Authorize Database Access
Mysql> grant select, insert, update, delete, create, drop, alter on database name. * to database name @ localhost identified by 'new password ';
Query OK, 0 rows affected (0.17 Sec)

-- Authorize Database Access
Mysql> set password for 'database name' @ 'localhost' = old_password ('new password ');
Query OK, 0 rows affected (0.03 Sec)

-- Query the character encoding of a Database
Mysql> show variables like 'Char % ';
Mysql> show variables like 'collation _ % ';
Mysql> show variables like 'character _ SET _ % ';

-- Change Database
Mysql> Use Database Name;

-- Create all data tables from a file
Mysql> source C:/createtable. SQL;

-- Import all data tables from a file
Mysql> source C:/tabledata. SQL;

-- Delete a database
Mysql> drop Databse database name;

-- Exit MySQL database
C: \ PhP5 \ mysql545 \ bin> exit;

 

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.