MySQL ̐ݒ sw-79# rm -rf /opt/mysql/mysql/data sw-79# rm -rf /var/lib/mysql sw-79# /opt/mysql/mysql/scripts/mysql_install_db --user=mysql --ldata=/var/mysql Installing MySQL system tables... InnoDB: The first specified data file ./ibdata1 did not exist: InnoDB: a new database to be created! 091027 0:54:58 InnoDB: Setting file ./ibdata1 size to 10 MB InnoDB: Database physically writes the file full: wait... 091027 0:54:58 InnoDB: Log file ./ib_logfile0 did not exist: new to be created InnoDB: Setting log file ./ib_logfile0 size to 5 MB InnoDB: Database physically writes the file full: wait... 091027 0:54:58 InnoDB: Log file ./ib_logfile1 did not exist: new to be created InnoDB: Setting log file ./ib_logfile1 size to 5 MB InnoDB: Database physically writes the file full: wait... InnoDB: Doublewrite buffer not found: creating new InnoDB: Doublewrite buffer created InnoDB: Creating foreign key constraint system tables InnoDB: Foreign key constraint system tables created 091027 0:54:59 InnoDB: Started; log sequence number 0 0 091027 0:54:59 InnoDB: Starting shutdown... 091027 0:55:00 InnoDB: Shutdown completed; log sequence number 0 46409 091027 0:55:00 [Warning] Forcing shutdown of 1 plugins OK Filling help tables... 091027 0:55:00 InnoDB: Started; log sequence number 0 46409 091027 0:55:01 InnoDB: Starting shutdown... 091027 0:55:03 InnoDB: Shutdown completed; log sequence number 0 46409 091027 0:55:03 [Warning] Forcing shutdown of 1 plugins OK To start mysqld at boot time you have to copy support-files/mysql.server to the right place for your system PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! To do so, start the server, then issue the following commands: /opt/mysql/mysql/bin/mysqladmin -u root password 'new-password' /opt/mysql/mysql/bin/mysqladmin -u root -h sw-79 password 'new-password' Alternatively you can run: /opt/mysql/mysql/bin/mysql_secure_installation which will also give you the option of removing the test databases and anonymous user created by default. This is strongly recommended for production servers. See the manual for more instructions. You can start the MySQL daemon with: cd /opt/mysql/mysql ; /opt/mysql/mysql/bin/mysqld_safe & You can test the MySQL daemon with mysql-test-run.pl cd /opt/mysql/mysql/mysql-test ; perl mysql-test-run.pl Please report any problems with the /opt/mysql/mysql/scripts/mysqlbug script! The latest information about MySQL is available at http://www.mysql.com/ Support MySQL by buying support/licenses from http://shop.mysql.com/ sw-79# vi /etc/my.cnf sw-79# cat /etc/my.cnf [mysqld] basedir = /opt/mysql/mysql datadir = /var/mysql default-storage-engine = InnoDB character-set-server = utf8 sw-79# cp /opt/mysql/mysql/support-files/mysql.server /etc/init.d/mysql sw-79# /etc/init.d/mysql start Starting MySQL . SUCCESS! sw-79# //opt/mysql/mysql/bin/mysqladmin -u root password 'password' sw-79# //opt/mysql/mysql/bin/mysql_secure_installation NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MySQL to secure it, we'll need the current password for the root user. If you've just installed MySQL, and you haven't set the root password yet, the password will be blank, so you should just press enter here. Enter current password for root (enter for none): OK, successfully used password, moving on... Setting the root password ensures that nobody can log into the MySQL root user without the proper authorisation. You already have a root password set, so you can safely answer 'n'. Change the root password? [Y/n] n ... skipping. By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? [Y/n] Y ... Success! Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? [Y/n] Y ... Success! By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? [Y/n] Y - Dropping test database... ... Success! - Removing privileges on test database... ... Success! Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? [Y/n] Y ... Success! Cleaning up... All done! If you've completed all of the above steps, your MySQL installation should now be secure. Thanks for using MySQL! sw-79# /opt/mysql/mysql/bin/mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 8 Server version: 5.1.36-enterprise-commercial-pro MySQL Enterprise Server - Pro Edition (Commercial) Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> CREATE DATABASE caldav CHARACTER SET = UTF8; Query OK, 1 row affected (0.00 sec) mysql> CREATE USER 'caldav'@'localhost' IDENTIFIED BY 'caldav'; Query OK, 0 rows affected (0.00 sec) mysql> SET PASSWORD FOR 'caldav'@'localhost' = PASSWORD('caldav'); Query OK, 0 rows affected (0.00 sec) mysql> GRANT ALL ON caldav.* TO 'caldav'@'localhost'; Query OK, 0 rows affected (0.00 sec) mysql> exit Bye sw-79#