- 論壇徽章:
- 0
|
最近phpwind升級8.7后,經(jīng)常出現(xiàn)宕機(jī)的現(xiàn)象,不是Apache卡死,吃光內(nèi)存機(jī)器重啟,就是mysql數(shù)據(jù)庫被鎖,無奈! 多個原因,apache的版本過低,導(dǎo)致執(zhí)行效率慢;另外數(shù)據(jù)庫版本過低,查詢語句多時,自動鎖!網(wǎng)站幾乎不能訪問!另外就是程序可能也有點問題,測試頁面可以正常訪問!主頁卻不能打開!
把apache升級到2.2版本,程序轉(zhuǎn)移到了另一臺機(jī)器上,搭建LAMP環(huán)境,用于編譯php, 已經(jīng)安裝好了mysql! 試著運行,發(fā)現(xiàn)機(jī)器運行正常,無負(fù)載超高的現(xiàn)象,可是網(wǎng)站還是會卡,數(shù)據(jù)庫還是會鎖死!
聯(lián)系到phpwind官方尋找技術(shù)支持,的確有bug,官方同意幫我們解決!
我們也考慮到把數(shù)據(jù)版本也升級下,由于機(jī)器暫時緊缺,只能在程序上搭建,一條船上前線,哈哈!
采用二進(jìn)制文件安裝mysql
初始化正常,添加mysql服務(wù),可是啟動的時候出現(xiàn)問題了
[root@localhost scripts]# /usr/local/mysql5.0.45/bin/mysqld_safe --defaults-file=/etc/my.cnf --user=mysql & [1] 31358 [root@localhost scripts]# The file /usr/local/mysql/bin/mysqld doesn't exist or is not executable Please do a cd to the mysql installation directory and restart this script from there as follows: ./bin/mysqld_safe. See http://dev.mysql.com/doc/mysql/en/mysqld_safe.html for more information \ [1]+ Exit 1 /usr/local/mysql5.0.45/bin/mysqld_safe --defaults-file=/etc/my.cnf --user=mysql
查看了很多資料,最終還是官方的文檔給力:
5. Change location into the installation directory:
shell> cd mysql
You will find several files and subdirectories in the `mysql' directory. The most important for installation purposes are the `bin' and `scripts' subdirectories:
* The `bin' directory contains client programs and the server. You should add the full pathname of this directory to your `PATH' environment variable so that your shell finds the MySQL programs properly. See *Note environment-variables::.
* The `scripts' directory contains the `mysql_install_db' script used to initialize the `mysql' database containing the grant tables that store the server access permissions.
6. Ensure that the distribution contents are accessible to `mysql'. If you unpacked the distribution as `mysql', no further action is required. If you unpacked the distribution as `root', its contents will be owned by `root'. Change its ownership to `mysql' by executing the following commands as `root' in the installation directory:
shell> chown -R mysql . shell> chgrp -R mysql .
The first command changes the owner attribute of the files to the `mysql' user. The second changes the group attribute to the `mysql' group.
7. If you have not installed MySQL before, you must create the MySQL data directory and initialize the grant tables:
shell> scripts/mysql_install_db --user=mysql
If you run the command as `root', include the `--user' option as shown. If you run the command while logged in as that user, you can omit the `--user' option.
The command should create the data directory and its contents with `mysql' as the owner.
After creating or updating the grant tables, you need to restart the server manually.
8. Most of the MySQL installation can be owned by `root' if you like. The exception is that the data directory must be owned by `mysql'. To accomplish this, run the following commands as `root' in the installation directory:
shell> chown -R root . shell> chown -R mysql data
9. If you want MySQL to start automatically when you boot your machine, you can copy `support-files/mysql.server' to the location where your system has its startup files. More information can be found in the `support-files/mysql.server' script itself and in *Note automatic-start::.
我之前執(zhí)行的是 chown -R mysql:mysql .
官方: shell> chown -R root .
shell> chown -R mysql data
最后修正重啟: [root@localhost mysql5.0.45]# chown -R root . [root@localhost mysql5.0.45]# chown -R mysql data [root@localhost mysql5.0.45]# ./bin/mysqld_safe --user=mysql & [1] 31480 [root@localhost mysql5.0.45]# Starting mysqld daemon with databases from /mysqldata
關(guān)閉重啟: [root@localhost mysql5.0.45]# /usr/local/mysql5.0.45/bin/mysqladmin -u root shutdown STOPPING server from pid file /mysqldata/localhost.localdomain.pid 110928 10:49:34 mysqld ended
[1]+ Done ./bin/mysqld_safe --user=mysql [root@localhost mysql5.0.45]# ./bin/mysqld_safe --user=mysql & [1] 31654 [root@localhost mysql5.0.45]# Starting mysqld daemon with databases from /mysqldata
正常!ok
|
|