Home >Database >Mysql Tutorial >MySql installation and usage graphic tutorial

MySql installation and usage graphic tutorial

黄舟
黄舟Original
2017-03-04 14:38:331759browse

MySQL is a relational database management system developed by the Swedish MySQL AB company and currently belongs to Oracle. MySQL is a relational database management system. A relational database stores data in different tables instead of putting all data in one large warehouse, which increases speed and flexibility. The SQL language used by MySQL is the most commonly used standardized language for accessing databases. MySQL software adopts a dual authorization policy (this entry "Authorization Policy"), which is divided into community version and commercial version. Due to its small size, fast speed and low total cost of ownership, especially the characteristics of open source, it is generally used by small and medium-sized enterprises. For website development, MySQL is chosen as the website database. Due to the excellent performance of its community version, it can form a good development environment with PHP and Apache.

Below I will introduce the process of installing MySQL for reference only.

1. The first step is to download Windows (x86, 64-bit) from http://dev.mysql.com/downloads/mysql/.

2. After the download is complete, decompress it to the path you want to install. For example, I decompressed it to the path D:\MySql. After decompression, the files should be as shown below. Folder:

3. Create a new my.ini configuration file, which will be overwritten The my-default.ini file in the current folder. The display file suffix set in the previous step is to prepare for this step. Open this configuration file and add the following code to the file:


[mysql]# 设置mysql客户端默认字符集
default-character-set=utf8 
[mysqld]#设置3306端口
port = 3306 # 设置mysql的安装目录
basedir=D:\MySql# 设置mysql数据库的数据的存放目录
datadir=D:\MySql\data
# 允许最大连接数
max_connections=200# 服务端使用的字符集默认为8比特编码的latin1字符集
character-set-server=utf8
# 创建新表时将使用的默认存储引擎
default-storage-engine=INNODB


4. Save after adding, and then create a new empty data file in this path folder, the data folder must be empty. The layout of the entire process should be as follows:

5. The preliminary preparations have been completed. The next step is to start installing the service. Run cmd.exe as an administrator. Remember to run it as an administrator and enter the bin directory of the installation. The most important and important commands are here. They are essential. Otherwise, the service cannot be started after installing the service. Enter the mysqld --initialize-insecure --user=mysql command and press Enter.

6. Then enter mysqld install to install the service. If the installation is successful, it will prompt that the installation is successful, and then start the MySQL service and it will be OK. .

7. Configure environment variables——>Right-click on the computer and "Properties"——>"Advanced System Settings" ——>"Environment Variables"——>"path"——>Copy the path of the bin directory to the path environment variable.

8. Open MySQL, open cmd.exe , enter mysql -uroot -p command, the default is no password, press Enter to enter. If some have already set a password, you need to enter the password to enter. If you have a password, you can mysql -uroot -p password, or mysql -uroot -p and press Enter to enter the password. The second option is recommended.

This concludes the tutorial on how to install and use mysql. Please forgive me if it’s not well written. You are welcome to make criticisms and suggestions!

The above is the content of the graphic tutorial on the installation and use of MySql. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn