Sunday, July 30, 2006

MySQL

  • Set up mysql (http://gentoo-wiki.com/HOWTO_MySQL)
  • Set up use flags for mysql
    • edit /etc/portage/package.use
    • add line: dev-db/mysql innodb berkdb
  • Install MySQL and its dependencies: emerge mysql
  • Create the initial mysql databases
    • get the mysql version: emerge -pv mysql => dev-db/mysql-4.1.20
    • emerge --config =dev-db/mysql-4.1.20
    • when prompted, enter a password for the root user
  • Start MySQL: /etc/init.d/mysql start
  • Add MySQL to load at boot: rc-update add mysql default
  • Set security
    • log into mysql: mysql -u root -p, enter password set above, not the linux root password
    • encrypt mysql root password: set password for 'root'@'localhost'=PASSWORD('');
  • Secure the installation
    • mysql_secure_installation
    • don't change the root password
    • remove anonymous users
    • disallow root login remotely
    • remove test database and access to it
    • reload privilege tables
  • Test databases:
    • log into mysql: mysql -u root -p
    • show databases

No comments: