简体   繁体   English

macOS Sierra上的mariadb 10.1.21 mysql.server启动错误

[英]mariadb 10.1.21 mysql.server start error on macOS Sierra

I have just installed mariadb 10.1.21 latest with brew. 我刚用brew安装了最新的mariadb 10.1.21。 here is what i got with command 这是我用命令得到的

> mysql.server start

or 要么

/usr/local/Cellar/mariadb/10.1.21/support-files/mysql.server start /usr/local/Cellar/mariadb/10.1.21/support-files/mysql.server start

whatever. 随你。

Starting MySQL
.170225 03:41:19 mysqld_safe Logging to '/usr/local/var/mysql/mac-615.err'.
170225 03:41:19 mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql
ERROR!

I do not know any reason why I cannot even start mysql daemon. 我什至不知道为什么我什至无法启动mysql守护程序。

I had the same problem today. 我今天有同样的问题。 What I did was just uninstalling both mariaDB and mysql. 我所做的只是卸载mariaDB和mysql。

Remember doing a backup of your DB's in case you need it. 请记住对数据库进行备份,以备不时之需。

Just run the following commands in you terminal: 只需在终端中运行以下命令:

For mysql: 对于mysql:

brew remove mysql

For mariaDB: 对于mariaDB:

brew remove mariadb

Then, remove mysql folders and files: 然后,删除mysql文件夹和文件:

sudo rm /usr/local/mysql
sudo rm -rf /usr/local/var/mysql
sudo rm -rf /usr/local/mysql*
sudo rm ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
vi /etc/hostconfig and remove the line MYSQLCOM=-YES-
rm -rf ~/Library/PreferencePanes/My*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
sudo rm -rf /private/var/db/receipts/*mysql*

Maybe, most of the folders and files won't exist, just to be sure they won't mess with the installation, do it. 也许,大多数文件夹和文件将不存在,只是为了确保它们不会干扰安装,请执行此操作。

After you have removed mysql and mariaDB files, run 删除mysql和mariaDB文件后,运行

brew cleanup

to ensure cache is gone. 确保缓存不见了。

Once it's done, you should be able to do a clean installation of mariadb with 完成后,您应该可以使用以下命令全新安装mariadb

brew install mariadb

Try your installation by running 通过运行尝试安装

mysql.server start

If hangs at starting, try restarting mysql with 如果在启动时挂起,请尝试使用重新启动mysql

mysql.server restart -f

By doing this, I was able to run mariadb, I hope it works for you. 通过这样做,我能够运行mariadb,希望它对您有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM