当前位置:Gxlcms > 数据库问题 > win10环境搭建MariaDB数据库

win10环境搭建MariaDB数据库

时间:2021-07-01 10:21:17 帮助过:15人阅读

.7-winx64\bin>net start MariaDB mariadb 服务正在启动 ... mariadb 服务无法启动。 系统出错。 发生系统错误 1067。 进程意外终止。

尝试了一些方法

进入到Mariadb的文件夹,data下面会有一个文件:主机名.err ,如下图

技术图片

使用文本格式打开该文件,即可查看到对应的错误信息,类似:

……
InnoDB: using atomic writes. 2019-08-23 10:50:16 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions 2019-08-23 10:50:16 0 [Note] InnoDB: Uses event mutexes 2019-08-23 10:50:16 0 [Note] InnoDB: Compressed tables use zlib 1.2.11 2019-08-23 10:50:16 0 [Note] InnoDB: Number of pools: 1 2019-08-23 10:50:16 0 [Note] InnoDB: Using SSE2 crc32 instructions 2019-08-23 10:50:16 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M 2019-08-23 10:50:16 0 [Note] InnoDB: Completed initialization of buffer pool 2019-08-23 10:50:16 0 [Note] InnoDB: 128 out of 128 rollback segments are active. 2019-08-23 10:50:16 0 [Note] InnoDB: Creating shared tablespace for temporary tables 2019-08-23 10:50:16 0 [Note] InnoDB: Setting file .\ibtmp1 size to 12 MB. Physically writing the file full; Please wait ... 2019-08-23 10:50:16 0 [Note] InnoDB: File .\ibtmp1 size is now 12 MB. 2019-08-23 10:50:16 0 [Note] InnoDB: Waiting for purge to start 2019-08-23 10:50:16 0 [Note] InnoDB: 10.4.7 started; log sequence number 113910; transaction id 9 2019-08-23 10:50:16 0 [Note] InnoDB: Loading buffer pool(s) from D:\mariadb-10.4.7-winx64\data\ib_buffer_pool 2019-08-23 10:50:16 0 [Note] Plugin FEEDBACK is disabled. 2019-08-23 10:50:16 0 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded 2019-08-23 10:50:16 0 [Note] InnoDB: Buffer pool(s) load completed at 190823 10:50:16 2019-08-23 10:50:16 0 [ERROR] Cant open and lock privilege tables: Table mysql.servers doesnt exist 2019-08-23 10:50:16 0 [Note] Server socket created on IP: ::. 2019-08-23 10:50:16 0 [ERROR] Fatal error: Cant open and lock privilege tables: Table mysql.db doesnt exist 2019-08-23 10:50:16 0 [ERROR] Aborting

笔者这里解决的办法: 初始化mysql:mysql_install_db

D:\mariadb-10.4.7-winx64\bin>mysql_install_db
Default data directory is D:\mariadb-10.4.7-winx64\data
Running bootstrap
2019-08-23 10:51:36 0 [Note] D:\mariadb-10.4.7-winx64\bin\mysqld.exe (mysqld 10.4.7-MariaDB) starting as process 15452 ...
Removing default user
Creating my.ini file
Creation of the database was successful

执行以上的命令后,系统会在MariaDb安装文件下的data生成对应的文件。然后再次执行启动服务:

D:\mariadb-10.4.7-winx64\bin>net start MariaDB
mariadb 服务正在启动 .
mariadb 服务已经启动成功。

 

  • 6、在CMD窗口,对应MariaDB的bin目录中执行:mysql -u root -p,如下:输入密码时,直接Enter,直接进入MariaDM模式
D:\mariadb-10.4.7-winx64\bin>mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 9
Server version: 10.4.7-MariaDB mariadb.org binary distribution

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type help; or \h for help. Type \c to clear the current input statement.

MariaDB [(none)]>
  • 7、由于新的数据库是没有密码的,所以需要进行设置密码的操作命令:SET PASSWORD FOR ‘root‘@‘localhost‘ = PASSWORD(‘root‘);

如下:

MariaDB [(none)]> SET PASSWORD FOR root@localhost = PASSWORD(‘root););
Query OK, 0 rows affected (0.001 sec)

注:红色的字体代表,需要增加的密码。笔者这里设置数据库密码是root。

8、可以通过mysql shell的命名查MariaDB数据库的库名信息:

D:\mariadb-10.4.7-winx64\bin>mysql -u root -p
Enter password: ****
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 10
Server version: 10.4.7-MariaDB mariadb.org binary distribution

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.

MariaDB [(none)]> show databases
-> ;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.001 sec)

 

win10环境搭建MariaDB数据库

标签:下载地址   进程   sse2   could not   x64   fat   开启   creating   waiting   

人气教程排行