Installation and basic management of MySQL

Source: Internet
Author: User
Tags mysql client mysql in

---restore content starts---

MySQL is a relational database management system developed by the Swedish MySQL AB company, currently owned by Oracle (Oracle) Corporation. MySQL's most popular relational database management system. MySQL is one of the best RDBMS (Relational DB Manager system, relational database management systems) application software for Web applications.

What is MySQL:

MySQL is a software based on the C/S architecture written by the socket.

Database management software Classification:

Relationship types: such as, Sqllite, DB2, Oracle, Access, SQL Server, MySQL. SQL statements are common.

Non-relational: Mongodb,redis, Memcache.

Relational databases are table-structured, and non-relational databases are key:value stored without a table structure.

Download and install MySQL:

: https://dev.mysql.com/downloads/mysql/

Initialization

Mysqld--initialize-insecure

To start the MySQL service:

mysqld // start MySQL Service

Start the MySQL client and connect to the MySQL server (requires a CMD window to be re-opened):

Mysql-uroot-P#   consecutive MySQL server

Make the MySQL service into a Windows service.

Note:--before install, you must use the absolute path of the MySQL boot command # to make the MySQL Windows service, execute this command at the terminal:"\ C Mysql-5.6.40-winx64\bin\mysqld" --install#  Remove the MySQL Windows service and execute this command at the terminal: " C:\mysql-5.7.16-winx64\bin\mysqld " --After the remove is registered as a service, when you start and close the MySQL service at a later time, you only need to execute the following command:#  start MySQL services net start MySQL#  close MySQL service net stop MySQL
Windows login Settings Password:

Open terminal, enter MySQL:

Enter the function provided by MySQL, select User (); Check the current login account.

The default account for the current login is [email protected]

If you want to switch to the root account login:

Default no password, direct enter to enter.

Mysql-uroot-p

View current user again: Select User ();

Set Administrator root account password:

" 123 "  # set the initial password, because the original password is empty, so-P can not

You need to enter a password to log in again:

If you want to change password 123 to 456:

Mysqladmin-uroot-p"123""456"  # modify MySQL Password , because you already have a password, you must enter the original password to set a new password

Password forgotten-crack password:

1, open cmd as Administrator

2. Stop the MySQL server:

net stop MySQL

3, execute the Command skip authorization table:

Mysqld--skip-grant-tables

4. Set the password to null:

Update Mysql.user set authentication_string =password (") where user='root ';

5, refresh the permissions, execute the command;

Flush privileges;

6, quit MySQL.

7, let the user go to load permissions, as administrator into cmd, view the current MySQL process

tasklist |findstr MySQL

8, kill the current process

' ID Code '

9, Login again, no password required.

Unified character Encoding:

Go to MySQL client and execute \s

To unify character encoding, do the following:

(1) My.ini file is a MySQL configuration file, creating My.ini file

(2) Save the following code copy.

# mysql5.5 Above: Modify the method to     [mysqld]    character-set-server=UTF8    collation-server=utf8_general_ci    [ Client]    default-character-set=UTF8    [MySQL]    default-character-set=utf8

(3) Restart the service as an administrator.

(4) Enter MySQL in cmd to enter MySQL environment, execute \s, display the following information, indicating success

Installation and basic management of MySQL

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.