2012年8月4日土曜日

Install MySQL on OpenSUSE 12

パッケージをインストールします。
# zypper install mysql-community-server mysql-community-client
Loading repository data...
Reading installed packages...
'mysql-community-client' not found in package names. Trying capabilities.
No provider of 'mysql-community-client' found.
Resolving package dependencies...

The following NEW packages are going to be installed:
  mysql-community-server mysql-community-server-client 
  mysql-community-server-errormessages 

3 new packages to install.
Overall download size: 8.0 MiB. After the operation, additional 60.5 MiB will 
be used.
Continue? [y/n/?] (y): y
Retrieving package mysql-community-server-errormessages-5.5.25-3.12.1.x86_64 (1/3), 146.0 KiB (1.0 MiB unpacked)
Retrieving: mysql-community-server-errormessages-5.5.25-3.12.1.x86_64.rpm [done]Retrieving package mysql-community-server-client-5.5.25-3.12.1.x86_64 (2/3), 736.0 KiB (17.1 MiB unpacked)
Retrieving: mysql-community-server-client-5.5.25-3.12.1.x86_64.rpm [done]Retrieving package mysql-community-server-5.5.25-3.12.1.x86_64 (3/3), 7.1 MiB (42.4 MiB unpacked)
Retrieving: mysql-community-server-5.5.25-3.12.1.x86_64.rpm [done]
Installing: mysql-community-server-errormessages-5.5.25-3.12.1 [done]
Installing: mysql-community-server-client-5.5.25-3.12.1 [done]
Installing: mysql-community-server-5.5.25-3.12.1 [done]
自動起動をOnにします。
# systemctl enable mysql.service
mysql.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig mysql on
サービスを起動します。
# systemctl start mysql.service
Failed to issue method call: Unit mysql.service failed to load: No such file or directory. See system logs and 'systemctl status mysql.service' for details.
エラーで起動できず。。。 原因がわからないので、一旦アンインストールして、パッケージの入手からやり直すことにします。 アンインストール。
# zypper remove mysql-community-server mysql-community-server-client mysql-community-server-errormessages
パッケージをMySQLのサイトからダウンロードします。SLESを選択して、MySQL ServerとClient Utilitiesをダウンロードします。 http://dev.mysql.com/downloads/mysql/5.5.html rpmパッケージをインストールします。
# rpm -ivh MySQL-server-5.5.27-1.sles11.x86_64.rpmPreparing...                ########################################### [100%]
ls: cannot access /var/lib/mysql/*.err: No such file or directory
ls: cannot access /var/lib/mysql/*.err: No such file or directory
   1:MySQL-server           ########################################### [100%]
insserv: Service network is missed in the runlevels 2 4 to use service mysql

Note: This output shows SysV services only and does not include native
systemd services. SysV configuration data might be overridden by native
systemd configuration.

mysql                     0:off  1:off  2:on   3:on   4:on   5:on   6:off

# rpm -ivh MySQL-client-5.5.27-1.sles11.x86_64.rpm
Preparing...                ########################################### [100%]
   1:MySQL-client           ########################################### [100%]
セキュリティ設定用のスクリプトを実行します。
# 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.

Set root password? [Y/n] 
New password: 
Re-enter new password: 
Password updated successfully!
Reloading privilege tables..
 ... Success!


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] 
 ... 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] 
 ... 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] 
 - 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] 
 ... 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!
お終い!

0 件のコメント:

コメントを投稿