* mysql 설치 후 맨 처음 실행 시 메시지


[root@localhost ~]# 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 localhost.localdomain 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  ]








Change or Set the MySQL Root password

For every database, you should set the root or sa passwords to something other than the default, unless you want to get hacked. For mysql, the system administrator user is called root. You will use the mysqladmin utility from a command line to set the new password. Notice that there are two commands to be run.

Syntax:

mysqladmin -u root password 'newpassword'

mysqladmin -u root -h host_name password 'newpassword'

Example:

mysqladmin -u root password 'ws8dr8as3'

mysqladmin -u root -h localhost password 'ws8dr8as3'

You will also want to restart the database server after running this command

sudo /etc/init.d/mysql restart



출처 - http://www.howtogeek.com/howto/mysql/set-the-mysql-root-password/








[mysql] mysqladmin 유틸리티

새로운 데이터베이스 생성
[root@byungun ~]# mysqladmin -u root -p create scbyun-db

특정 데이터베이스 삭제
[root@byungun ~]# mysqladmin -u root -p drop scbyun-db

MySQL의 권한테이블 갱신
[root@byungun ~]# mysqladmin -u root -p reload
(= mysql> flush privileges; 동일)

MySQL 접속한 사용자 확인
[root@byungun ~]# mysqladmin -u root -p processlist

접속되어 있는 MySQL사용자(threads)의 접속 끊기
[root@byungun ~]# mysqladmin -u root -p kill 8

MySQL의 간단한 실행정보 확인
[root@byungun ~]# mysqladmin -u root -p status

MySQL의 현재 상황 자세히 확인
[root@byungun ~]# mysqladmin -u root -p extended-status
(= mysql> show status; 동일)

MySQL의 환경변수 확인
[root@byungun ~]# mysqladmin -u root -p variables
(= mysql> show variables; 동일)

MySQL 정확한 버전과 여러가지 실행정보 확인
[root@byungun ~]# mysqladmin -u root -p version

MySQL이 죽었는지 살았는지 확인
[root@byungun ~]# mysqladmin -u root -p ping

리눅스 서버관리 실무 바이블 16장 참고하여 실습한 내용


출처 - http://sangchul.kr/4866812


'DB > MySQL' 카테고리의 다른 글

mysql 트리거 사용하기  (2) 2012.04.02
MySQL DATE 포맷 및 함수  (0) 2012.04.02
Mysql auto_increment  (0) 2012.03.30
mysql index 설정  (0) 2012.03.30
Mysql Command Line Client charset 설정  (0) 2012.03.27
Posted by linuxism
,