'mysql'에 해당하는 글 3건


mysql > SELECT User, Host FROM mysql.user;    # Show Users;


mysql > CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';         # Create an user


mysql > SET PASSWORD FOR 'username'@'localhost' = PASSWORD('new password');        # Set new password

mysql > FLUSH PRIVILEGES;



mysql> CREATE TABLE 'new_database'.'table' SELECT * FROM 'old_database'.'table';    # copy table to another database


mysql> SHOW TABLE STATUS FROM 'database';    # check Engine, Collation (e.g., character set) for all tables in a 'database'


mysql> DESCRIBE 'table' ;


mysql > DELETE FROM 'table_name';        # delete all rows in 'table_name'


WRITTEN BY
RootFriend
개인적으로... 나쁜 기억력에 도움되라고 만들게되었습니다.

,

"한글" insert DB 할때의, "Incorrect string value" Error 문제.


$ cd /etc/mysql

$ sudo vim ./my.cnf


[ mysql ]

default-character-set=utf8


[ client ]

default-character-set=utf8


[ mysqld ]

character-set-server=utf8

collation-server=utf8_unicode_ci

init_connect='SET NAMES utf8'


$ sudo service mysql restart


$ mysql -utest -p


mysql> ALTER TABLE table_name CONVERT TO character SET utf8;   /* 기존 table 변환 */






WRITTEN BY
RootFriend
개인적으로... 나쁜 기억력에 도움되라고 만들게되었습니다.

,


$ mysqldump -uroot -p "db_name" > dump_db.sql


$ mysqladmin -uroot -p create "new_db_name" (or just "db_name")

$ mysql -uroot -p "new_db_name" < dump_db.sql



WRITTEN BY
RootFriend
개인적으로... 나쁜 기억력에 도움되라고 만들게되었습니다.

,