MySQL 4.x Installation and Configuration Guide

From The Wiki Guide

Revision as of 12:32, 19 July 2006 by Jzpian (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

MySql Install

  • locate mysql (get an idea of where the ports are)
  • Client:
    1. cd /usr/ports/databases/mysql3x-client
    2. make install
    3. rehash
    4. sync
  • Server:
    1. cd /usr/ports/databases/mysql3x-server
    2. make install
    3. rehash
    4. sync
  • Configure Startup Script:
    1. ee /usr/local/etc/rc.d/mysql-server.sh
    2. FIND ${mysql_enable= and set it to ${mysql_enable="YES"}
    3. 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
    1. login to mysql mysql -u root -p
    2. mysql> create database testdb;
  • Creating a User, and giving them perms:
    1. login to mysql mysql -u root -p
    2. mysql> grant usage on testdb.* to pingu@localhost; (creates user pingu, who can use testdb database)
    3. 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....