MySQL No installation configuration

Source: Internet
Author: User
Tags mysql command line mysql login

1, Windows7 under the MySQL5.5.20 free installation version of the configuration

(1), download Mysql-5.5.20-win32.zip, extract to the E:\appcenter,e Disk AppCenter folder will appear mysql-5.5.25-winx64 directory, rename it to MySQL.

(2), configure the environment variables of MySQL

New system variable: Mysql_home with a value of E:\AppCenter\mysql
On the last side of the path variable, add:;%mysql_home%\bin

(3), new file My.ini, add the following simple configuration in the My.ini file: (My.ini is saved in the same directory as My-large.ini) (#表示注释)

1 # The following options would be passed to all MySQL clients 2 [Client] 3 #password   = Your_password  4Port        = 3306  5    6[ MySQL]  7#设置mysql客户端的字符集 8default-character-set = UTF8  9    Ten# The MySQL server[mysqld]    Port        = 3306#设置mysql的安装目录 basedir = E:\AppCenter\mysql  the #设置mysql数据库的数据存放目录, it must be data or \xxx-data.  - DataDir = E:\AppCenter\mysql\data  - #设置服务器段的字符集  character_set_server = UTF8

(4), install MySQL for system services

Run the command line with administrator privileges and execute the following command:

Mysqld--install MySQL--defaults-file=e:\appcenter\mysql\my.ini

(4), after saving can be logged in with root

1 mysql-uroot-p

Enter the password will be required, the default password is empty, the direct carriage can enter the MySQL command line.

(5), change the root password

Execute the following two commands separately (the first root is the password):

1 Update Mysql.user Set Password=password ("root") where user= "root"; 2 flush privileges;

The results of the execution are as follows:

1 mysql> Update mysql.user set Password=password ("root") where user= "root"; 2 Query OK, 3 Rows Affected (0.00 sec) 3 Rows Matched:3  Changed:3  warnings:045mysql> flush privileges; 6 Query OK, 0 rows Affected (0.00 sec)

(6) Quit MySQL login, log in again enter the password you just designed, check whether it can be used properly

1 mysql> exit;2 Bye3 4 e:\appcenter\mysql\bin>mysql-uroot-p5 Enter Password: * * *6 Welcome to the MySQL Monitor. Commands End With; or \g.7 Your MySQL Connection ID is 48 server version:5.5.25 MySQL Community Server (GPL)9 Ten Copyright (c), +, Oracle and/or its affiliates. All rights reserved. One  A Oracle is a registered trademark of the Oracle Corporation and/or its - affiliates. Other names trademarks of their respective - owners. the  - Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement. -  - mysql> show databases; + +--------------------+ - | Database | + +--------------------+ A | information_schema | at | mysql | - | performance_schema | - | test | - +--------------------+ - 4 rows in Set (0.00 sec) -  inMysql>

Reference Link: http://supportopensource.iteye.com/blog/1415527

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.