Mysql database installation and configuration, mysql Database Configuration

Source: Internet
Author: User
Tags django website

Mysql database installation and configuration, mysql Database Configuration

Http://blog.csdn.net/pipisorry/article/details/46773507

Download and install mysql

Download MySQL Installer

Set the Administrator account and password during installation.

Note:

1. If dependency is not installed locally, MySQL Workbench (SQL integrated development environment) may not be installed ).

2. MySQL Installer is 32 bit, but will install both 32 bit and 64 bit binaries.

3. If the mysql installation stops at start service and the installation fails, refer to [django website building record 1]



Start mysql

Start the mysql server

1. Right-click the mysql icon in the windows taskbar> running> start

2.Start Menu> all programs> Mysql> mysql notifier starts notifier. The mysql icon appears on the right of the taskbar and starts automatically.

Start the mysql command line client

Start Menu> all programs> Mysql> mysql server 5.6> mysql command line client

Start the mysql database service environment in Django

E: \ mine \ python_workspace \ VoteSite>Python manage. py dbshell

...

Welcome to the MySQL monitor. Commands end with; or \ g.
Your MySQL connection id is 2
Server version: 5.6.24-log MySQL Community Server (GPL)

...
Type 'help; 'or' \ H' for help. type' \ C' to clear the current input statement.

Mysql>

Note: If an error occurs in python manage. py dbshell 'mysql' is not recognized as an internal or external command, operable prog, because the mysql path is not added to the system path. You can add it. E.g. C: \ Program Files \ MySQL Server 5.6 \ bin \ mysql.exe;

Mysql cannot be started and its status cannot be changed

The Service MYSQL56 was not found in the Windows Service
Solution:

Mysql icon on the right of the taskbar> right-click> action> manage monitored items> services> Delete Mysql, open the instances page, delete instance> services> add> windows service> Mysql, and then OK!

What is the difference between mysqld.exe and mysql.exe?

Mysqld.exe is a MySQL Background Program (that is, a MySQL Server ). To use a client program, the program must run because the client accesses the database by connecting to the server.
Mysql.exe is a command line Client tool that comes with MySQL. It is a command line tool that interactively enters SQL statements or executes them in batch mode from files.
To put it simply, mysqld is a command used to start the mysql database, while mysql is a command used to open and execute SQL statements.

Http://blog.csdn.net/pipisorry/article/details/46773507


Database Files

Path for storing mysql database files

For LINUX compiling and installation, specify -- localstatedir = your_data_path during configure;

For Windows: MySQL data is stored in "$ MySQL installation path \ data" by default ". E.g. datadir = "C:/ProgramData/MySQL Server 5.5/Data /"

Note:
1. Find the installation path of MySQL and open the my. ini file in notepad.
2. Find the following content in this file:
# Path to the database root
Datadir = "C:/ProgramData/MySQL Server 5.6/Data /"
If you want to view the content, you can use the database connection tool or command line statements such as SLELECT to query the content.

MySQL creates a database and specifies the path of the database.
Method 1.If you want to make the db_name of a database not exist, you can create a file "db_name.sym" under the default data directory of the database, where the content is the path where you want to store it, for example, "E: \ mysql \ data \ db_name \", make sure this folder exists.
Method 2.Modify my. INI file, change datadir = "C:/ProgramData/MySQL Server 5.1/Data/" to the path D: \ Data. First, make sure the path exists, and copy the MySQL folder under C:/ProgramData/MySQL/mysql Server 5.1/Data/to D:/Data. If you do not copy the data, the mysql service cannot be started. Restart the mysql service.

Note:

1. C: \ ProgramData \ MySQL Server 5.6 directory has my. ini and my_2015-04-15T10-42-54.ini

2. C: \ Program Files \ MySQL Server 5.6 directory has a my-default.ini, Administrator permission to modify but do not modify

Move Table files in a database

When you move the instance, you will be prompted that mysql is in use. You only need to disable the mysql server.



Use of mysql syntax, special symbols, and regular expressions

From: http://blog.csdn.net/pipisorry/article/details/46773507

Ref: http://www.linuxidc.com/Linux/2013-07/88024.htm


Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

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.