The DigitalPimp
Ben Pfountz |
NOTE: If you are using MYSQL 4.1.1 or higher, you much use the MySQLi interface in PHP, which is seperate from the MySQL interface.
Install the port...
cd /usr/ports/databases/mysql41-server make WITH_OPENSSL=YES OVERWRITE_DB=YES BUILD_OPTIMIZED=YES install make clean
MySQL will only be used locally, adjust startup script...
edit /usr/local/etc/rc.d/mysql-server.sh and add --bind-address=127.0.0.1 to mysql startup. /usr/local/etc/rc.d/mysql-server.sh start netstat | grep "3306" tcp4 0 0 localhost.3306 *.* LISTEN
MySQL install requires some security setup... mysql drop database
test; quit mysqladmin reload
mysql -p [enter your root password] create database pictures;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, Show_db_priv, Super_priv, Create_tmp_table_priv, Lock_tables_priv, Execute_priv, Repl_slave_priv, Repl_client_priv, ssl_type, ssl_cipher, x509_issuer, x509_subject, max_questions, max_updates, max_connections) values ('localhost','[username]',password('[password]'), 'Y','Y','Y','Y','N','N','N','N','N','N','N','N','Y','N','N','N','N', 'N','N','N','N','','','','',0,0,0); insert into host (Host, Db, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv, Grant_priv, References_priv, Index_priv, Alter_priv, Create_tmp_table_priv, Lock_tables_priv) values ('localhost','pictures','Y','Y','Y','Y','N','N','N','N', 'Y','N','N','N'); insert into db (Host, Db, User, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv, Grant_priv, References_priv, Index_priv, Alter_priv, Create_tmp_table_priv, Lock_tables_priv) values ('localhost','pictures','[username]','Y','Y','Y','Y','Y', 'Y','N','N','Y','N','N','N'); mysqladmin reload
Note, mysql is a little tricky after first installation. You can run the mysql client without a password, and it will give you access to the database, but since you did not log in as root, you dont have permission to change any settings. You need to specify '-u root' when logging in, and '-p' if you have a password set.
If you have forgotten the root password, or never knew it in the first place: # /usr/local/etc/rc.d/mysqld.sh stop |
|