LoginSignup
2
1

More than 3 years have passed since last update.

CentOS 6にMySQL 5.1をインストール(OS標準)

Last updated at Posted at 2019-10-21

はじめに

CentOS6にMySQLを標準インストール
親記事:MySQL, MariaDBの各種インストール方法とEOLまとめ - Qiita

LOG

インストール

cat /etc/redhat-release
CentOS release 6.10 (Final)

# yum install -y mysql-server
... 略

mysql起動/停止

初回起動時には初期設定関係のメッセージが表示される。

# service mysqld start
Initializing MySQL database:  Installing MySQL system tables...
OK
Filling help tables...
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:

/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h 57db8f7c1234 password 'new-password'

Alternatively you can run:
/usr/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 /usr ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/bin/mysqlbug script!

                                                           [  OK  ]
Starting mysqld:                                           [  OK  ]

# service mysqld status
mysqld (pid  284) is running...
# service mysqld stop
Stopping mysqld:                                           [  OK  ]

# service mysqld status
mysqld is stopped

mysql自動起動設定/設定解除

# chkconfig mysqld on
# chkconfig --list mysqld
mysqld          0:off   1:off   2:on    3:on    4:on    5:on    6:off
# chkconfig mysqld off
# chkconfig --list mysqld
mysqld          0:off   1:off   2:off   3:off   4:off   5:off   6:off

各種確認

# service mysqld start
Starting mysqld:                                           [  OK  ]

# mysql -u root -e'select version();'
+-----------+
| version() |
+-----------+
| 5.1.73    |
+-----------+
2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1