| 订阅 | 在线投稿
分享
 
 
当前位置: 王朝网络 >> mysql >> ru he zai Unix xi tong huan jing xia an zhuang MySQL shu ju ku

ru he zai Unix xi tong huan jing xia an zhuang MySQL shu ju ku

2008-07-01 06:56:50 编辑來源:互联网 评论
 
 
 
本文为【如何在Unix系统环境下安装MySQL数据库】的拼音翻译版
  an zhuang shi jian yi ni wei MySQL guan li chuang jian yi ge yong hu he zu 。 you gai zu yong hu yun xing mysql fu wu qi bing zhi xing guan li ren wu 。( ye ke yi yi root shen fen yun xing fu wu qi , dan shi bu tui jian )
  di yi bu chuang jian yi ge yong hu lai yun xing fu wu qi 。 zai Solaris he unix xia , ke yi yong useradd he groupadd shi yong gong ju lai wan cheng 。 qu yi ge ming zi jiao mysql ba 。( dang ran , ren he ni xi huan de id dou ke yi ) suo yi zai zuo qi ta shi qing zhi qian , li yong su ming ling cheng wei root:
  $ su - root
  $ groupadd mysql
  $ useradd -g mysql mysql
  xuan ze yao an zhuang mysql ruan jian de wei zhi , bing jiang dang qian mu lu zhuan huan dao gai mu lu 。 yi ban de , jiang an zhuang dao /usr/local, zhe shi MySQL ruan jian de biao zhun an zhuang wei zhi 。 xian zai jin qu ,
  $ cd /usr/local
  jie kai ruan jian bao :
  $ gunzip -c /tmp/mysql -3.23.xx.tar.gz | tar -xf -
  yin wei yao an zhuang zai Solaris fu wu qi shang , suo yi ru guo an zhuang de shi bu tong ban ben de tar, li ru GNU de tar, ze shang mian de ming ling jiang bu hui qi zuo yong 。 zhe shi yao yong xia mian de ming ling :
  $ gunzip -c /tmp/mysql -3.23.xx.tar.gz | gtar -xf -
  xian zai ke yi cha kan yi xia xin mu lu , kan shi fou cun zai
  $ ls -ld mysql*
  total 1
  drwxr-xr-x 28 user user 1024 Jul 18 14:29 mysql-3.23.x/
  xia yi bu shi chuang jian yi ge fu hao lian jie , yi bian an zhuang neng gou zhi xiang /usr/local/mysql:
  $ ln -s mysql-3.23.x mysql
  $ ls -ld mysql*
  jiu hui chu xian biao shi lian jie cheng gong de xing lai 。 an zhao shang tie ruan jian an zhuang hao hou , huan you ji xiang pei zhi ren wu yao wan cheng 。 yun xing scripts/mysql_install_db chuang jian MySQL xu ke biao :
  $ scripts/mysql_install_db
  Preparing db talbe
  Preparing host table
  Preparing user table
  Preparing func table
  Preparing tables_priv table
  Preparing columns_priv table
  Installing all prepared tables
  010726 19:40:05 ./bin/mysqld: Shutdown Complete
  she zhi er jin zhi wen jian de suo you quan , cong er shi zhi gui root suo you , bing shu yu qian mian chuang jian de MySQL
  guan li yuan zu ( zhe ge li zi wei mysql)
  $ chown -R root /usr/local/mysql
  $ chgrp -R mysql /usr/local/mysql
  jiang shu ju mu lu de suo you quan she zhi wei xian qian chuang jian de MySQL guan li yong hu
  $ chown -R mysql /usr/local/mysql/data
  suo you quan she zhi wan cheng
  qi dong fu wu qi xu yun xing safe_mysqld:
  $ bin/safe_mysqld --usr=mysql &
  yi ban yao rang MySQL zai fu wu qi yin dao shi jiu yun xing 。 wei ci , ke yi jiang support-files/mysql.server fu zhi dao xi tong shi dang de wei zhi jiu ok le 。
  wei le que bao MySQL neng zheng chang gong zuo , xu yao yun xing yi xie jian dan de ce shi . ru guo shu chu jie guo : BINDIR = /usr/local/mysql/bin, jiu zheng ming MySQL gong zuo zheng chang . BINDIR de zhi yu shang mian xuan ze de prefix xuan xiang you guan 。
  --------------------------------------------------------------------------------
  # BINDIR/mysqlshow -p
  +---------------+
  | Databases |
  +---------------+
  | mysql |
  +---------------+
  --------------------------------------------------------------------------------
  yi dan ni an zhuang le MySQL, ta jiang hui zi dong sheng cheng liang ge shu ju ku 。 yi ge yong yu guan li yong hu 、 zhu ji he fu wu qi shu ju ku quan xian 。 ling yi ge shi ce shi shu ju ku (test database)。 wo men ke yi shi yong ce shi shu ju ku 。 dan shi , wo men xiang jian dan kuai jie de xiang ni jie shao MySQL zhong yi xie ke shi yong de zhi ling de gai mao 。 zhe huan ke yi que bao root bei she zhi wei neng gou wan quan fang wen fu wu qi , li ru : root ke yi yuan xu chuang jian shu ju ku 、 biao dan deng .. suo yi wo men jiang chuang jian yi ge test2 shu ju ku yong yu yi hou de ce shi 。 zai tong guo zhi ling jin ru MySQL qian , xi tong jiang ti shi shu ru xin chuang jian de root kou ling 。 ying gai ji de ni yi gai guo root de kou ling le 。
  --------------------------------------------------------------------------------
  # mysql -u root -p
  mysql> show databases;
  +----------------+
  | Database |
  +----------------+
  | mysql |
  | test |
  +----------------+
  mysql> create database test2;
  Query OK, 1 row affected (0.00 sec)
  --------------------------------------------------------------------------------
  an zhao xia mian liang duan dai ma , xuan ze shi yong xin de shu ju ku , bing chuang jian yi ge ming cheng wei tst_tbl de biao , ta you liang ge zi duan 。 di yi ge zi duan (field 1) wei id zi duan , tong guo ta ke yi kan dao ji lu de id hao 。 cong ben zhi shang kan , zhe zhi shi yi lie chun shu zi 。 di er ge zi duan wei ming cheng zi duan , zai qi zhong ke yi cun chu shu de ming cheng 。 zhe xie zi duan de ge shi wei : field 1 (id) wei chang du wei 3 de zheng shu xing (int), field 2 (name) wei chang du wei 50 de zi fu chuan xing (char)。 wo men dui id de fu zhi ke yi dui shu ju cha zhao he biao yin 。
  --------------------------------------------------------------------------------
  mysql> use test2;
  Database changed
  mysql> CREATE TABLE books ( id int(3) not null
  -> auto_increment, name char(50) not null,
  -> unique(id), primary key(id));
  Query OK, 0 rows affected (0.00 sec)
  --------------------------------------------------------------------------------
  xian zai yong xia mian ming ling jian cha ku shi fou zheng que 。
  --------------------------------------------------------------------------------
  mysql> show tables;
  +---------------------+
  | Tables in test2 |
  +---------------------+
  | books |
  +---------------------+
  1 row in set (0.00 sec)
  mysql> describe books;
  +-------+-------------+------+------+----------+----------------+
  | Field | Type | Null | Key | Default | Extra |
  +-------+-------------+------+------+----------+----------------+
  | id | int(3) | | PRI | 0 | auto_increment |
  | name | char(50) | |
  +-------+-------------+------+------+----------+----------------+
  2 rows in set (0.00 sec)
  --------------------------------------------------------------------------------
  zhu yi :describe zhi ling ji ben miao hui chu biao de bu ju 。
  OK, xia mian jie shao yi xie zhen zheng you yong de SQL zhi ling : ru he zai shu ju ku zhong cha ru he xuan ze shu ju 。 xian zai ke yi xiang xin jian biao zhong jia ru ji tiao ji lu 。
  --------------------------------------------------------------------------------
  mysql> INSERT INTO books (name) values(PHP 4 Newbies);
  Query OK, 1 row affected (0.00 sec)
  mysql> INSERT INTO books (name) values(Red Hat Linux 6 Server);
  Query OK, 1 row affected (0.00 sec)
  --------------------------------------------------------------------------------
  xian zai jian cha yi xia xin de ji lu , bing shu xi yi xia select zhi ling 。
  -------------------------------------------------------------------------------
  mysql> SELECT * from books;
  +----+----------------------------------+
  | id | name |
  +----+----------------------------------+
  | 1 | PHP for Newbies |
  | 2 | Red Hat Linux 6 Server |
  +----+----------------------------------+
  2 rows in set (0.00 sec)
  --------------------------------------------------------------------------------
  zhe yang MySQL fu wu qi de jiu yi jing neng zheng chang yun xing le 。 wo men ke yi ji xu zeng jia ji lu , dan shi zai ci jiu mei you geng duo yi yi le 。
  zhu yi : dang ni xiang shu ju ku cha ru ji lu shi , bu bi zhi ding id。 zhe shi yin wei ni chuang jian id zi duan you zi dong zeng jia de xuan xiang 。
  xia mian jie shao ru he jin xing kuai su shan chu 。 zhe zhi shi gei ni yi ge jian dan xin xi , ji zhu ni ke yi zai mysql web zhan dian http://www.mysql.com zhao dao suo you ni suo xiang yao de mysql zhi ling he fu wu qi de xin xi 。
  --------------------------------------------------------------------------------
  mysql> delete from books where id=1;
  Query OK, 1 row affected (0.00 sec)
  mysql> select * from books;
  +----+-----------------------------------+
  | id | name |
  +----+-----------------------------------+
  | 2 | Red Hat Linux 6 Server |
  +----+-----------------------------------+
  1 row in set (0.00 sec)【原文】【汉音对照
 
 
 
 
 
 
 
 
 
日版宠物情人插曲《Winding Road》歌词

日版宠物情人2017的插曲,很带节奏感,日语的,女生唱的。 最后听见是在第8集的时候女主手割伤了,然后男主用嘴帮她吸了一下,插曲就出来了。 歌手:Def...

兄弟共妻,我成了他们夜里的美食

老钟家的两个儿子很特别,就是跟其他的人不太一样,魔一般的执着。兄弟俩都到了要结婚的年龄了,不管自家老爹怎么磨破嘴皮子,兄弟俩说不娶就不娶,老父母为兄弟两操碎了心...

如何磨出破洞牛仔裤?牛仔裤怎么剪破洞?

把牛仔裤磨出有线的破洞 1、具体工具就是磨脚石,下面垫一个硬物,然后用磨脚石一直磨一直磨,到把那块磨薄了,用手撕开就好了。出来的洞啊很自然的。需要猫须的话调几...

我就是扫描下图得到了敬业福和爱国福

先来看下敬业福和爱国福 今年春节,支付宝再次推出了“五福红包”活动,表示要“把欠大家的敬业福都还给大家”。 今天该活动正式启动,和去年一样,需要收集“五福”...

冰箱异味产生的原因和臭味去除的方法

有时候我们打开冰箱就会闻到一股异味,冰箱里的这种异味是因为一些物质发出的气味的混合体,闻起来让人恶心。 产生这些异味的主要原因有以下几点。 1、很多人有这种习...

 
 
an zhuang shi jian yi ni wei MySQL guan li chuang jian yi ge yong hu he zu 。 you gai zu yong hu yun xing mysql fu wu qi bing zhi xing guan li ren wu 。( ye ke yi yi root shen fen yun xing fu wu qi , dan shi bu tui jian ) di yi bu chuang jian yi ge yong hu lai yun xing fu wu qi 。 zai Solaris he unix xia , ke yi yong useradd he groupadd shi yong gong ju lai wan cheng 。 qu yi ge ming zi jiao mysql ba 。( dang ran , ren he ni xi huan de id dou ke yi ) suo yi zai zuo qi ta shi qing zhi qian , li yong su ming ling cheng wei root: $ su - root $ groupadd mysql $ useradd -g mysql mysql xuan ze yao an zhuang mysql ruan jian de wei zhi , bing jiang dang qian mu lu zhuan huan dao gai mu lu 。 yi ban de , jiang an zhuang dao /usr/local, zhe shi MySQL ruan jian de biao zhun an zhuang wei zhi 。 xian zai jin qu , $ cd /usr/local jie kai ruan jian bao : $ gunzip -c /tmp/mysql -3.23.xx.tar.gz | tar -xf - yin wei yao an zhuang zai Solaris fu wu qi shang , suo yi ru guo an zhuang de shi bu tong ban ben de tar, li ru GNU de tar, ze shang mian de ming ling jiang bu hui qi zuo yong 。 zhe shi yao yong xia mian de ming ling : $ gunzip -c /tmp/mysql -3.23.xx.tar.gz | gtar -xf - xian zai ke yi cha kan yi xia xin mu lu , kan shi fou cun zai $ ls -ld mysql* total 1 drwxr-xr-x 28 user user 1024 Jul 18 14:29 mysql-3.23.x/ xia yi bu shi chuang jian yi ge fu hao lian jie , yi bian an zhuang neng gou zhi xiang /usr/local/mysql: $ ln -s mysql-3.23.x mysql $ ls -ld mysql* jiu hui chu xian biao shi lian jie cheng gong de xing lai 。 an zhao shang tie ruan jian an zhuang hao hou , huan you ji xiang pei zhi ren wu yao wan cheng 。 yun xing scripts/mysql_install_db chuang jian MySQL xu ke biao : $ scripts/mysql_install_db Preparing db talbe Preparing host table Preparing user table Preparing func table Preparing tables_priv table Preparing columns_priv table Installing all prepared tables 010726 19:40:05 ./bin/mysqld: Shutdown Complete she zhi er jin zhi wen jian de suo you quan , cong er shi zhi gui root suo you , bing shu yu qian mian chuang jian de MySQL guan li yuan zu ( zhe ge li zi wei mysql) $ chown -R root /usr/local/mysql $ chgrp -R mysql /usr/local/mysql jiang shu ju mu lu de suo you quan she zhi wei xian qian chuang jian de MySQL guan li yong hu $ chown -R mysql /usr/local/mysql/data suo you quan she zhi wan cheng qi dong fu wu qi xu yun xing safe_mysqld: $ bin/safe_mysqld --usr=mysql & yi ban yao rang MySQL zai fu wu qi yin dao shi jiu yun xing 。 wei ci , ke yi jiang support-files/mysql.server fu zhi dao xi tong shi dang de wei zhi jiu ok le 。 wei le que bao MySQL neng zheng chang gong zuo , xu yao yun xing yi xie jian dan de ce shi . ru guo shu chu jie guo : BINDIR = /usr/local/mysql/bin, jiu zheng ming MySQL gong zuo zheng chang . BINDIR de zhi yu shang mian xuan ze de prefix xuan xiang you guan 。 -------------------------------------------------------------------------------- # BINDIR/mysqlshow -p +---------------+ | Databases | +---------------+ | mysql | +---------------+ -------------------------------------------------------------------------------- yi dan ni an zhuang le MySQL, ta jiang hui zi dong sheng cheng liang ge shu ju ku 。 yi ge yong yu guan li yong hu 、 zhu ji he fu wu qi shu ju ku quan xian 。 ling yi ge shi ce shi shu ju ku (test database)。 wo men ke yi shi yong ce shi shu ju ku 。 dan shi , wo men xiang jian dan kuai jie de xiang ni jie shao MySQL zhong yi xie ke shi yong de zhi ling de gai mao 。 zhe huan ke yi que bao root bei she zhi wei neng gou wan quan fang wen fu wu qi , li ru : root ke yi yuan xu chuang jian shu ju ku 、 biao dan deng .. suo yi wo men jiang chuang jian yi ge test2 shu ju ku yong yu yi hou de ce shi 。 zai tong guo zhi ling jin ru MySQL qian , xi tong jiang ti shi shu ru xin chuang jian de root kou ling 。 ying gai ji de ni yi gai guo root de kou ling le 。 -------------------------------------------------------------------------------- # mysql -u root -p mysql> show databases; +----------------+ | Database | +----------------+ | mysql | | test | +----------------+ mysql> create database test2; Query OK, 1 row affected (0.00 sec) -------------------------------------------------------------------------------- an zhao xia mian liang duan dai ma , xuan ze shi yong xin de shu ju ku , bing chuang jian yi ge ming cheng wei tst_tbl de biao , ta you liang ge zi duan 。 di yi ge zi duan (field 1) wei id zi duan , tong guo ta ke yi kan dao ji lu de id hao 。 cong ben zhi shang kan , zhe zhi shi yi lie chun shu zi 。 di er ge zi duan wei ming cheng zi duan , zai qi zhong ke yi cun chu shu de ming cheng 。 zhe xie zi duan de ge shi wei : field 1 (id) wei chang du wei 3 de zheng shu xing (int), field 2 (name) wei chang du wei 50 de zi fu chuan xing (char)。 wo men dui id de fu zhi ke yi dui shu ju cha zhao he biao yin 。 -------------------------------------------------------------------------------- mysql> use test2; Database changed mysql> CREATE TABLE books ( id int(3) not null -> auto_increment, name char(50) not null, -> unique(id), primary key(id)); Query OK, 0 rows affected (0.00 sec) -------------------------------------------------------------------------------- xian zai yong xia mian ming ling jian cha ku shi fou zheng que 。 -------------------------------------------------------------------------------- mysql> show tables; +---------------------+ | Tables in test2 | +---------------------+ | books | +---------------------+ 1 row in set (0.00 sec) mysql> describe books; +-------+-------------+------+------+----------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------+-------------+------+------+----------+----------------+ | id | int(3) | | PRI | 0 | auto_increment | | name | char(50) | | +-------+-------------+------+------+----------+----------------+ 2 rows in set (0.00 sec) -------------------------------------------------------------------------------- zhu yi :describe zhi ling ji ben miao hui chu biao de bu ju 。 OK, xia mian jie shao yi xie zhen zheng you yong de SQL zhi ling : ru he zai shu ju ku zhong cha ru he xuan ze shu ju 。 xian zai ke yi xiang xin jian biao zhong jia ru ji tiao ji lu 。 -------------------------------------------------------------------------------- mysql> INSERT INTO books (name) values(PHP 4 Newbies); Query OK, 1 row affected (0.00 sec) mysql> INSERT INTO books (name) values(Red Hat Linux 6 Server); Query OK, 1 row affected (0.00 sec) -------------------------------------------------------------------------------- xian zai jian cha yi xia xin de ji lu , bing shu xi yi xia select zhi ling 。 ------------------------------------------------------------------------------- mysql> SELECT * from books; +----+----------------------------------+ | id | name | +----+----------------------------------+ | 1 | PHP for Newbies | | 2 | Red Hat Linux 6 Server | +----+----------------------------------+ 2 rows in set (0.00 sec) -------------------------------------------------------------------------------- zhe yang MySQL fu wu qi de jiu yi jing neng zheng chang yun xing le 。 wo men ke yi ji xu zeng jia ji lu , dan shi zai ci jiu mei you geng duo yi yi le 。 zhu yi : dang ni xiang shu ju ku cha ru ji lu shi , bu bi zhi ding id。 zhe shi yin wei ni chuang jian id zi duan you zi dong zeng jia de xuan xiang 。 xia mian jie shao ru he jin xing kuai su shan chu 。 zhe zhi shi gei ni yi ge jian dan xin xi , ji zhu ni ke yi zai mysql web zhan dian http://www.mysql.com zhao dao suo you ni suo xiang yao de mysql zhi ling he fu wu qi de xin xi 。 -------------------------------------------------------------------------------- mysql> delete from books where id=1; Query OK, 1 row affected (0.00 sec) mysql> select * from books; +----+-----------------------------------+ | id | name | +----+-----------------------------------+ | 2 | Red Hat Linux 6 Server | +----+-----------------------------------+ 1 row in set (0.00 sec)
󰈣󰈤
  免责声明:本文仅代表作者个人观点,与王朝网络无关。王朝网络登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述,其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
华丽的模特拍摄(8)
华丽的模特拍摄(7)
华丽的模特拍摄(6)
华丽的模特拍摄(5)
八里沟
朝阳宫
天下峨眉 云上金顶
老家(四)
 
>>返回首页<<
 
 
 为你推荐
 
 
 
 转载本文
 UBB代码 HTML代码
复制到剪贴板...
 
 热帖排行
 
 
 
 
 
©2005- 王朝网络 版权所有