Use notes for mysql cmd line in win7 (1. Installation and Use)

Source: Internet
Author: User

Mysql cmd line in win7 uses note (1. Installation and Use). If you want to learn more, continue to study the database. As the saying goes, good memory is not as bad as writing a pen. Now we rely on the Internet to remember and save energy and environmental protection. Start. Mysql has been installed under www.2cto.com win7, and no other configuration has been made. I plan to finish this series of learning in three steps: Installation and use; web application mysql (project); in-depth mysql server performance analysis. 1. To enable, restart, and disable the MySql server, you can disable or enable the MySql service in Windows 7. However, the win7 Service Manager is often not found. The main Positioning method is 2: Enter services. msc under the command line; Control Panel> system and security> Management Tools> service. Command Line in win7. Go to the bin directory of the database installation directory, enter net start mysql to enable, and enter net stop mysql to disable the service. 2. The premise for connecting to the mysql server under win7 and executing the Operation Command is that the above bin directory. Establish a connection at www.2cto.com: mysql-h localhost-uroot-ppassword (enter mysql> command) status disconnect: mysql> exit list database/table: mysql> show databases/tables; create database: mysql> create database mydb; use database: mysql> use mydb; create data table user: mysql> create table user-> (-> id int (4) not null auto_inrement primary key, -> name varchar (20),-> sex char (1),-> birth date); create a data table user; view the data table structure: mysql> describe user; filter data: mysql> select ......; (various databases are used) Command for terminating the error: mysql> c; database/table deletion: drop database/table; 3. database permission and security password modification: mysqladmin-u root-p password mypasswd requires you to enter the root password for confirmation before you can change it to mypasswd. Set MySQL to the C drive. the mysql database username is root, the password is 123, and the database name is db_name, store the backup database under the root directory of disk d. the backup database name is backup20110527. SQL backup database: mysqldump-uroot-p123 db_name> d: \ backup20110527. SQL to restore the database: delete the original database mysqladmin-uroot-p123 drop db_name create DATABASE mysqladmin-uroot-p123 create db_name import the backup database to mysql-uroot-p 123 db_name <d: \ backup20110527. SQL Note: before importing the backup database, if db_name does not exist, it must be created. Besides, it must be the same as the database name in backup20110527. SQL before importing. 4. A list of mysql tools is provided. The above is only a commonly used tool. In fact, there are still many mysql tools, which can be found in a complete user manual. Mysqld-it's a server daemon. this is the database server main binary (executable) mysqlimport mysqlbinlog mysqlcheck mysqlhotcopy mysql_upgrade ......

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.