MySQL 4.x Installation and Configuration Guide
From The Wiki Guide
MySql Install
- locate mysql (get an idea of where the ports are)
- Client:
- cd /usr/ports/databases/mysql3x-client
- make install
- rehash
- sync
- Server:
- cd /usr/ports/databases/mysql3x-server
- make install
- rehash
- sync
- Configure Startup Script:
- ee /usr/local/etc/rc.d/mysql-server.sh
- FIND ${mysql_enable= and set it to ${mysql_enable="YES"}
- Run the script /usr/local/etc/rc.d/mysql-server.sh
- Since the script is placed in rc.d, it will start Mysql on boot
- Check that MySql is running "ps aux | grep mysql"
- Location of the Database files: /var/db/mysql
- Changing the root password: mysqladmin -u root password newpassword
- After that when logging in use mysqladmin -u root -p (it will prompt for pass which is more secure)
- Creating a DB
- login to mysql mysql -u root -p
- mysql> create database testdb;
- Creating a User, and giving them perms:
- login to mysql mysql -u root -p
- mysql> grant usage on testdb.* to pingu@localhost; (creates user pingu, who can use testdb database)
- mysql> grant select, insert,delete on testdb.* to pingu@localhost;(Lets pingu select insert and delete)
- There are tons and tons of more options, this is just a basic, Q&D....