MySQL learning: mysql installation, phpstady installation and use, and my.ini file configuration

MySQL learning

PS: This article mainly describes personal installation and call experience

The first one is to download and install directly from the official website

1. Installation process

  1. mysql download path ;
  2. Choose according to your own operating system
  3. The process is as follows
    1. Choose versionInsert picture description here

    2. Download versionInsert picture description here

    3. Find the directory where the file is located, unzip and install

    4. Enter mysql to know the bin location, copy this path, configure environment variables ( mainly install the mysql environment so that the mysqld command can be used ).

      1. Specific configuration 1, as shown in the figure:Insert picture description here

      2. Specific configuration 2, as shown in the figure:Insert picture description here

    5. After the configuration is complete, enter the folder where bin is located, and create a new file under the same level: my.ini

The specific content information of my.ini is as follows

[mysql]
default-character-set=utf8
#这种文件,网上很多,根据各自需要进行更改
[mysqld]
port=3306
#根据自身安装的路径进行替换
basedir=D:/phpstudy_pro/Extensions/MySQL5.7.26/
datadir=D:/phpstudy_pro/Extensions/MySQL5.7.26/data/
character-set-server=utf8
default-storage-engine=MyIsam
max_connections=1000
collation-server=utf8_unicode_ci
init_connect='SET NAMES utf8'
innodb_buffer_pool_size=64M
innodb_flush_log_at_trx_commit=1
innodb_lock_wait_timeout=120
innodb_log_buffer_size=4M
innodb_log_file_size=256M
interactive_timeout=2880000
join_buffer_size=2M
key_buffer_size=32M
log_error_verbosity=1
max_allowed_packet=500M
max_heap_table_size=64M
myisam_max_sort_file_size=64G
myisam_sort_buffer_size=32M
read_buffer_size=512kb
read_rnd_buffer_size=4M
server_id=1
skip-external-locking=on
sort_buffer_size=256kb
table_open_cache=256
thread_cache_size=16
tmp_table_size=64M
wait_timeout=2880000
#根据自身安装的路径进行替换
log-error=D:/phpstudy_pro/Extensions/MySQL5.7.26/data

[client]
port=3306
default-character-set=utf8

2. mysqld operation

Start by cmd administrator, cd /d D:\bin, run the command (the path is not necessarily the same)

  1. mysqld --initialize --console View initial user information (you can see the user name and password)
  2. mysqld install installs the database
  3. net start mysql start the database
  4. net stop mysql close the database
  5. sc delete mysql delete the database server (mainly used when the user cannot connect to the database)
  6. mysql -u root -p to enter the database (user name and password are required)

ps: Need to perform other mysqld operations, please find by yourself

Second, download phpstady and install it (recommended)

  1. phpstady download path

  2. Version selection

  3. Unzip and install (same as the first)

  4. Environment configuration (same as the first)

  5. Start phpstady (open the local server), the details are as follows:

    1. Main interface configurationInsert picture description here

    2. Website configurationInsert picture description here

    3. Software management configurationInsert picture description here

    4. Set face configurationInsert picture description here

  6. End of installation

Note: easy problems

If you use phpstady, you don’t need to configure environment variables, but you can’t use the mysqld command

If you configure the environment variables and find that MySQL cannot be started, the solution is as follows:

  1. Run cmd as administrator
  2. Enter the mysqld file
  3. Execute the command sc delete mysql to delete the database server .

Guess you like

Origin blog.csdn.net/m0_46442996/article/details/108658895