First, download, install
1. Download mariadb (https://downloads.mariadb.org/), unzip
2, the implementation (administrator model -powershell) into the bin directory
.\mysqld.exe --install mariadb
Display:
Service Installed successfully.
Successful
3, execution
net start mariadb
Display:
MariaDB service is starting ...
MariaDB service can not start.
system error.
System error 1067.
The process terminated unexpectedly.
4, add parameters to perform again
.\mysql_install_db --user=mysql -d D:\develop\mariadb-10.4.7-winx64\data
显示:
D:\develop\mariadb-10.4.7-winx64\bin\mysql_install_db.exe: unknown variable 'user=mysql'
5, removal of user = mysql, execute again
.\mysql_install_db -d D:\develop\mariadb-10.4.7-winx64\data
显示:
Running bootstrap
2019-08-15 21:37:52 0 [Note] D:\develop\mariadb-10.4.7-winx64\bin\mysqld.exe (mysqld 10.4.7-MariaDB) starting as process 6240 ...
Removing default user
Creating my.ini file
Creation of the database was successful
成功
Second, start, modify codes
6, start the service
Start MariaDB NET
NET STOP MariaDB - closed
7, log database
.\mysql.exe -uroot
8. Check coding
show variables like 'character%';
显示:
+--------------------------+--------------------------------------------------+
| Variable_name | Value |
+--------------------------+--------------------------------------------------+
| character_set_client | gbk |
| character_set_connection | gbk |
| character_set_database | latin1 |
| character_set_filesystem | binary |
| character_set_results | gbk |
| character_set_server | latin1 |
| character_set_system | utf8 |
| character_sets_dir | D:\develop\mariadb-10.4.7-winx64\share\charsets\ |
+--------------------------+--------------------------------------------------+
9, to modify the coding utf8
set character_set_client=utf8; set character_set_connection=utf8; set character_set_database=utf8; set character_set_results=utf8; set character_set_server=utf8;
10, see the results of coding modified
to perform:
show variables like 'character%';
显示:
+--------------------------+--------------------------------------------------+
| Variable_name | Value |
+--------------------------+--------------------------------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | D:\develop\mariadb-10.4.7-winx64\share\charsets\ |
+--------------------------+--------------------------------------------------+
Third, building a database, building users, plus rights
11, building a database simple
create database simple default charset utf8 collate utf8_general_ci;
12, create a simple user
create user 'simple'@'localhost' identified by '123456';
Create a localhost login user simple, password is 123456
13, give permission
grant all on simple.* to 'simple'@'localhost' with grant option;
All rights given to users of the library simple simple, and has permission to operate.
14, login authentication
mysql -usimple -p123456
Fourth, find coding problems, modify
15, after modification, restart log on, find coding to restore the
online search, he said that the above settings are temporary, and needs global settings.
set global character_set_client=utf8;
After some operations, it found or does not work.
16, try to modify the configuration file to resolve the
search again, there is reform of the configuration file, win10 is my.ini
D: \ Develop \ MariaDB-10.4.7-Winx64 \ the Data \ my.ini
amended as follows:
[mysqld] character_set_server = utf8 datadir=D:/develop/mariadb-10.4.7-winx64/data [mysql] default-character-set = utf8 [mysql.server] default-character-set = utf8 [client] default-character-set = utf8 plugin-dir=D:/develop/mariadb-10.4.7-winx64/lib/plugin
17, after modification, or not found, delete the database, rebuild, delete tables, re-build, or not.
The change is before? Become garbled.
Internet search a times, no idea. Because I was connected via powershell, I thought, put on a navicat look at it, in the end what reason.
After installed, found normal, no distortion, so targeting the powershell.
18, modification distortion powershell
Reference: https: //blog.csdn.net/weixin_43426860/article/details/83348284
Control Panel - Regional - Management - Change system locale, check using utf-8.
After the restart, the display normally.