- 论坛徽章:
- 0
|
OpenBSD3.7下如何安装mysql
Install Mysql Package
Code:
# pkg_add mysql-client-3.23.55.tgz # pkg_add p5-DBI-1.30.tgz # pkg_add p5-DBD-Msql-Mysql-1.22.19.tgz # pkg_add mysql-server-3.23.55.tgz
Add this to the end of the start up script /etc/rc.local. It will activate MySql on startup.
Code:
# vi /etc/rc.local rm -R /var/www/var/run/mysql mkdir -p /var/www/var/run/mysql /usr/local/bin/mysqld_safe --user=mysql -log & sleep 10 ln /var/run/mysql/mysql.sock /var/www/var/run/mysql/mysql.sock
( Sleep 10 is to make sure there is enough time for mysql.sock to be created)
I know there are slicker ways of doing this. But, the above method seems to give me the least amount of problems.
Add the following to /etc/rc.conf or create it in a new file /etc/rc.conf.local. This will start your sftp, apache server, and start your Mysql. If you set MySql to know, it will not run the script to turn on mysql in rc.local. ( If you do not want Apache to be chroot, then change httpd_flags to read httpd_flags=¨-DSSL¨ )
Code:
# vi /etc/rc.conf.local httpd_flags="-DSSL" shlib_dirs="$shlib_dirs /usr/local/lib/mysql"
Now since I don¡¦t like rebooting we are going do this. Start MySql and Change the password for root. Then copy MySql default setup file.
Code:
# /usr/local/bin/safe_mysqld & # /usr/local/bin/mysqladmin -u root password 'new password'
Reboot computer
THIS SECTION ONLY APPLIES IF YOU CANNOT CONNECT TO MySQL using mysql -h 127.0.0.1 -u root -p , and you need to connect from 127.0.0.1. If that is the case, MySql is not allowing local loop back look up. Here is a fix ( thnx to alex lee for the help on this)
Code:
# mysql -uroot -p mysql>; use mysql; mysql>; INSERT INTO user (Host, User, Password, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv, Reload_priv, Shutdown_priv, Process_priv, File_priv, Grant_priv, References_priv, Index_priv, Alter_priv) VALUES('127.0.0.1','root',PASSWORD('New password') ,'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y'); mysql>; FLUSH PRIVILEGES; mysql>; select host, user, select_priv, grant_priv, password from user;
完整的web等安装地址可以参考这里
http://www.bsdforums.org/forums/showthread.php?t=9986&page=3&pp=15 |
|