zoukankan      html  css  js  c++  java
  • Mysql On Mac OS: Remove & Install

    If you downloaded and installed from .dmg package already, and mightbe sometime it sucks because of some reason like me, i gem install mysql2.

    1 Remove mysql from you Mac OS X

    1.1 backup your database by mysqldump, of course if you want to.

    1.2 stop the database. "sudo mysqladmin shutdown" or from the preference panel.

    1.3 remove MySQL binary and configuration files

    sudo rm /usr/local/mysql
    sudo rm -rf /usr/local/mysql*
    

     1.4 If MySQL automatically at boot and the system preference panel,

    sudo rm -rf /Library/StartupItems/MySQLCOM
    sudo rm -rf /Library/PreferencePanes/My*
    rm -rf ~/Library/PreferencePanes/My*
    

     1.5 mac OS keeps track of installed applications by tracking "receipts". 

    sudo rm -rf /Library/Receipts/mysql*
    sudo rm -rf /Library/Receipts/MySQL*
    

     Then look for receipts in a different location. Open up /Library/Receipts/InstallHistory.plist, find the entry for MySQL, delete the entry.

    One more location: look in /private/var/db/receipts/ and search for mysql in the directory. There should be 2 files, delete them.

    2 Install by Homebrew

    brew install mysql

    mkdir -p ~/Library/LaunchAgents
    ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents
    launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
    mysql.server start
     

    Then if mysql start successfully, 

    mysql_secure_installation
    

     step by step.

    PS: You might get this error:

     “ERROR! The server quit without updating PID file”.

    sudo chmod -R 755 /usr/local/var/mysql
    $ rm -Rf /usr/local/var/mysql/Your-Machine-Name.local.err
    

     2 

    ps aux | grep mysql
    

     Then "kill -9 xxxx" to kill all the progress.

    3

    mv /etc/my.cnf /etc/my.cnf.old
    

    4

    mv /var/lib/mysql/ib_logfile* /root/
    

     May be other reasons, hope this helps.

    http://nali.org/remove-mysql-from-mac-os-x-snow-leopord/

    http://benjsicam.me/blog/how-to-install-mysql-on-mac-os-x-using-homebrew-tutorial/

    http://linuxadministrator.pro/blog/?p=225

  • 相关阅读:
    函数对象中的prototype属性
    undefined和null的区别
    访问修饰符
    继承
    静态成员和实例成员的区别
    js模拟Trim()方法
    连接池的执行原理
    Javascript中的= =(等于)与= = =(全等于)区别
    数据库中创建约束
    KM算法入门
  • 原文地址:https://www.cnblogs.com/iosdev/p/3385991.html
Copyright © 2011-2022 走看看