macos
macos下php+mysql不能使用localhost连接的问题解决
因为localhost是通过socket方式来连接,而127.0.0.1则是走的TCP协议。所以需要重新设置php-mysql的配置文件
$echo "show variables" | mysql | grep "socket" socket /opt/local/var/run/mysql5/mysqld.sock $vi /opt/local/var/db/php5/mysql.ini ; Do not edit this file; it is automatically generated by MacPorts. ; Any changes you make will be lost if you upgrade or uninstall php5-mysql. ; To configure PHP, edit /opt/local/etc/php5/php.ini. extension=mysql.so extension=mysqli.so extension=pdo_mysql.so mysql.default_socket= /opt/local/var/run/mysql5/mysqld.sock mysqli.default_socket= /opt/local/var/run/mysql5/mysqld.sock pdo_mysql.default_socket= /opt/local/var/run/mysql5/mysqld.sock
设置mysql.default_socket,mysqli.default_socket,pdo_mysql.default_socket
ubuntu和macos在右上角增加系统状态监控system monitor
在ubuntu下面可以使用sudo apt-get install indicator-multiload
在mac下使用免费的MenuMeters
http://www.ragingmenace.com/software/menumeters/index.html
MacOs修改MySQL的默认编码设置
my.ini文件位置
$ cd /opt/local/etc/mysql5/ $ sudo cp /opt/local/share/mysql5/mysql/my-small.cnf my.cnf $ sudo vi my.cnf [mysqld] ... collation_server = utf8_general_ci character_set_server = utf8
搞定,MadOs各种版本的mysql的下载地址是
http://dev.mysql.com/downloads/mysql/
英文Mac os中文flash乱码解决
echo 25:52 >~/.CFUserTextEncoding