MySQL备忘录_MySQL

WBOY
풀어 주다: 2016-06-01 12:59:04
원래의
832명이 탐색했습니다.

在 openSUSE 12.1 操作系统中安装并配置 MySQL 数据库服务器:

$ <strong>sudo zypper install mysql-community-server</strong>
$ <strong>sudo vim /etc/my.cnf</strong>
[mysqld]
sql-mode="TRADITIONAL"
$ <strong>sudo /sbin/chkconfig --add mysql</strong>
$ <strong>sudo /etc/init.d/mysql start</strong>
$ <strong>sudo /usr/bin/mysql_secure_installation</strong>
$ <strong>mysql -u root -p****</strong>
mysql> CREATE DATABASE test charset ucs2;
mysql> GRANT ALL PRIVILEGES ON test.* TO test@"%" IDENTIFIED BY "pwd-for-test";
mysql> exit
로그인 후 복사

在 Windows Vista 操作系统使用 MySQL 客户端:

D:\Bin\MySQL\Workbench> <strong>mysql -h test.skyiv.com -u test -ppwd-for-test test</strong>
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.5.16-log 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 &#39;help;&#39; or &#39;\h&#39; for help. Type &#39;\c&#39; to clear the current input statement.

mysql> <strong>select version(),user(),now(),database();</strong>
+------------+--------------------+---------------------+------------+
| version()  | user()             | now()               | database() |
+------------+--------------------+---------------------+------------+
| 5.5.16-log | test@192.168.1.203 | 2012-02-24 19:37:24 | test       |
+------------+--------------------+---------------------+------------+
1 row in set (0.00 sec)

mysql> <strong>select @@sql_mode;</strong>
+------------------------------------------------------------------------------------------------------------------------------------------------------+
| @@sql_mode                                                                                                                                           |
+------------------------------------------------------------------------------------------------------------------------------------------------------+
| STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |
+------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.01 sec)

mysql> <strong>exit</strong>
Bye

D:\Bin\MySQL\Workbench>
로그인 후 복사
관련 라벨:
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!