[mysql] 우분투 mysql 설치 후 셋팅
mysql 환경설정파일 :/etc/my.cnf
[root@nmpweb01 /]# find . -name mysqld
./etc/rc.d/init.d/mysqld
./etc/logrotate.d/mysqld
./usr/libexec/mysqld
./var/run/mysqld
./var/lock/subsys/mysqld
[root@nmpweb01 /]# find . -name mysql
./usr/bin/mysql
./usr/lib64/mysql
./usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/DBD/mysql
./usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/auto/DBD/mysql
./usr/lib/mysql
./usr/include/mysql
./usr/share/mysql
./var/lib/mysql
./var/lib/mysql/mysql
[root@nmpweb01 /]# cd /usr/bin
[root@nmpweb01 bin]#
[root@nmpweb01 bin]#
[root@nmpweb01 bin]# killall mysqld
[root@nmpweb01 bin]# mysqld_safe --skip-grant &
[1] 28564
[root@nmpweb01 bin]# Starting mysqld daemon with databases from /var/lib/mysql
[root@nmpweb01 bin]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 5.0.95 Source distribution
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| gamekok |
| gmile |
| mysql |
| test |
| zipcode_manage |
+--------------------+
6 rows in set (0.01 sec)
mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> show tables;
+---------------------------+
| Tables_in_mysql |
+---------------------------+
| columns_priv |
| db |
| func |
| help_category |
| help_keyword |
| help_relation |
| help_topic |
| host |
| proc |
| procs_priv |
| tables_priv |
| time_zone |
| time_zone_leap_second |
| time_zone_name |
| time_zone_transition |
| time_zone_transition_type |
| user |
+---------------------------+
17 rows in set (0.00 sec)
mysql>
[root@nmpweb01 bin]# ps -ef | grep mysqld
root 28780 1 0 17:20 ? 00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --socket=/var/lib/mysql/mysql.sock --pid-file=/var/run/mysqld/mysqld.pid --basedir=/usr --user=mysql
mysql 28862 28780 0 17:20 ? 00:00:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-external-locking --log-error=/var/log/mysqld.log --socket=/var/lib/mysql/mysql.sock
root 28913 27780 0 17:22 pts/1 00:00:00 grep mysqld
[root@nmpweb01 bin]# kill 28862
[root@nmpweb01 bin]#
[root@nmpweb01 bin]# ./mysqld_safe --user=mysql --skip-grant-tables &
[1] 28933
[root@nmpweb01 bin]# Starting mysqld daemon with databases from /var/lib/mysql
[root@nmpweb01 bin]#
[root@nmpweb01 bin]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 53
Server version: 5.0.95 Source distribution
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> update user set password=password('password') where user='root';
Query OK, 3 rows affected (0.00 sec)
Rows matched: 4 Changed: 3 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> exit!
Aborted
[root@nmpweb01 bin]#
[root@nmpweb01 bin]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 21
Server version: 5.0.95 Source distribution
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> grant all privileges on *.* to 'gmile'@'localhost' identified by 'password' with grant option;
Query OK, 0 rows affected (0.00 sec)
mysql> grant all privileges on *.* to 'gmile'@'%' identified by 'password' with grant option;
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql>
[mysql] 우분투 mysql 설치 후 셋팅
'database > mysql' 카테고리의 다른 글
[mysql] 증가값 초기화 설정하기 (0) | 2013.11.14 |
---|---|
[mysql] 테이블명 대소문자 구분 없애기 (0) | 2013.10.29 |
[mysql] 지난 날짜 비교해서 가져오기 (0) | 2013.10.02 |
[mysql] 유지보수에 필요한 명령어 (0) | 2013.07.25 |
[mysql] 쿼리시 null 체크 (0) | 2013.07.10 |