블로그 이미지
박공명

카테고리

분류 전체보기 (99)
된장 (7)
Dev (60)
꼐..꼐임 (6)
식탐 (18)
우리 (0)
Etc (8)
개인자료 (0)
Total
Today
Yesterday

'MySQL'에 해당되는 글 2건

  1. 2014.01.22 라즈베리파이 리눅스에 mysql 설치 백업 복원
  2. 2010.05.20 mysql 설치(windows)

일단 설치를 한다

 

apt-get install mysql-server mysql-client

 

설치중에 비밀번호를 입력한다.

설치후에 접속해서 기초적인 설정을 한다.

 

mysql -p

 

암호치고 

 

디비와 유저를 생성해준다.

 

mysql> create database gmproject;
Query OK, 1 row affected (0.00 sec)

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| gmproject          |
| mysql              |
| performance_schema |
+--------------------+
4 rows in set (0.01 sec)

mysql> grant select,insert,update,delete,create,drop,alter on gmproject.* to 'pgmman'@'%' identified by '비밀';
Query OK, 0 rows affected (0.01 sec)

mysql>
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)

 

exit로 종료하고

생성한 아뒤로 접속하면된다.

 

root@raspberrypi:/usr/local/apache-tomcat-6.0.37/webapps/web# mysql -u pgmman -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 51
Server version: 5.5.33-0+wheezy1 (Debian)

Copyright (c) 2000, 2013, 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 gmproject
Database changed

 

자 나는 한단계 더가서

기존 사용하던 디비의 정보를 새로 설치한 서버에 옮기고싶다.

기존 윈도우 시스템에서 백업을 수행한다.

 

E:\APPLICATION\mysql-5.1.48\bin>mysqldump -uroot -p gmproject > gmproject.sql
Enter password: *******

E:\APPLICATION\mysql-5.1.48\bin>dir *.sql
 E 드라이브의 볼륨: MAIN_APP
 볼륨 일련 번호: F862-C7B4

 E:\APPLICATION\mysql-5.1.48\bin 디렉터리

2014-01-22  오후 03:51            13,906 gmproject.sql
               1개 파일              13,906 바이트
               0개 디렉터리  17,593,155,584 바이트 남음

E:\APPLICATION\mysql-5.1.48\bin>

 

전에 설치한 ftp서버를 통하여 백업파일을 업로드한다.

그담에 복원명령어 치면 끝

 

root@raspberrypi:/home/pi# mysql -u root -p gmproject < ./gmproject.sql
Enter password:
root@raspberrypi:/home/pi# mysql -upgmman -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 54
Server version: 5.5.33-0+wheezy1 (Debian)

Copyright (c) 2000, 2013, 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 gmproject
Database changed
mysql> show tables;
+---------------------+
| Tables_in_gmproject |
+---------------------+
| board               |
| developer           |
| menu                |
| uploadfiles         |
| user                |
+---------------------+
5 rows in set (0.01 sec)

mysql>

정상적으로 들어왔다.
 

Posted by 박공명
, |

mysql 설치(windows)

Dev/Mysql / 2010. 5. 20. 11:03

windows 7  에서 설치함.

1. 원하는 위치에 mysql 을 위치시킵니다.

2. 일단 환경변수에 mysql의 bin 위치를입력해주기.

3. mysql 최상단의 ini파일중 맘에드는놈을 골라잡아 편집한다.

4. 기본 경로들을 지정해준다.
basedir=e:/project/mysql
datadir=e:/project/mysql/data

5. 서버를 기동시킨다.
mysqld --defaults-file=(ini파일경로.ini) --console --character-set-server=euckr

6. 서버를 죽인다.
mysqladmin -u root -p shutdown

7. 서버키구 유저와 데이타베이스를만든다

GRANT ALL PRIVILEGES ON (데이타베이스이름).* to 유저이름@(localhost,%) IDENTIFIED BY '패스워드' WITH GRANT OPTION;
flush privileges;

 



'Dev > Mysql' 카테고리의 다른 글

characterset utf8 setting  (1) 2010.06.07
Posted by 박공명
, |

최근에 달린 댓글

최근에 받은 트랙백

글 보관함