分享java帶來的快樂

          我喜歡java新東西

          在linux自帶mysql基礎上再裝新的mysql

          預處理:
          rpm -q mysql;
          rpm -e --nodeps mysql;

          1.groupadd mysql
          2.useradd -g mysql mysql
          3.下載 mysql-standard-5.0.21-linux-i686-glibc23.tar.gz
          4.放到/usr/local
          5.tar -xvzf mysql-standard-5.0.21-linux-i686-glibc23.tar.gz
          6.ln -s mysql****** mysql (將解壓后的mysql目錄軟連接成mysql,或者直接更名為mysql也可,只是以后沒辦法看mysql版本)
          7.chown -R mysql.mysql mysql (一定要帶-R)
          8.執(zhí)行一下./scripts/mysql_install_db --user=mysql (注意一定要在/usr/local/mysql目錄下執(zhí)行該命令,不能到scripts下執(zhí)行mysql_install_db,目錄結構有關系)
          9.這時將在/usr/local/mysql/data 生成一個用戶數(shù)據(jù)庫(mysql)和一個test數(shù)據(jù)庫 (一定要確認)
          10.把/etc/my.cnf文件改名或刪掉
          11.cd /usr/local/mysql/support-file
          12.cp mysql.server /etc/rc.d/init.d/mysqld
          13.cp my-huge.cnf ../data
          14.所有操作都是用root的 
          啟動mysql用以下兩種方式均可
          (1)/etc/rc.d/init.d/mysqld start 
          (2)service mysqld start
          15.修改root密碼
           mysqladmin -u root password 'new-password'
          16.創(chuàng)建用戶,后付所有權限

          1 用于程序發(fā)布中,指定數(shù)據(jù)庫,指定用戶,權限小不影響工作(程序和數(shù)據(jù)庫服務器在同一臺機器上,否則用指定IP或域名)
          grant select, insert, update, delete on notebase.* to nb@localhost identified by 'nb123';

          不推薦使用%,這樣所有的IP都能連接,不過只能對notebase操作
          grant select, insert, update, delete on notebase.* to nb@"%" identified by 'nb123';

          2 用于程序開發(fā)中,讓指定開發(fā)人員的機器有最高訪問權限
          grant ALL PRIVILEGES on *.* to root@"10.0.0.11" Identified by "root" WITH GRANT OPTION;

          flush privileges

          17.進入mysql
           mysql -uroot -p770511
          18.關閉數(shù)據(jù)庫:
           mysqladmin -uroot -pxxxx -hxxxxxxxxx  shutdown
          19(啟動,關閉,連接數(shù)據(jù)庫時可能出現(xiàn) 無法找到/usr/lib/mysql/mysql.sock錯誤,這是因為,機器本身自帶的mysql 把socket通信文件指定在/usr/lib/mysql/mysql.sock,這時只要將本身自帶的mysql和mysqladmin命令文件刪除,并把/usr/local/mysql/bin置入PATH環(huán)境變量即可正常使用)



          Installing MySQL system tables...
          OK
          Filling help tables...
          OK

          To start mysqld at boot time you have to copy
          support-files/mysql.server to the right place for your system

          PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
          To do so, start the server, then issue the following commands:

          /usr/local/mysql/bin/mysqladmin -u root password 'new-password'
          /usr/local/mysql/bin/mysqladmin -u root -h localhost.localdomain password 'new-password'

          Alternatively you can run:
          /usr/local/mysql/bin/mysql_secure_installation

          which will also give you the option of removing the test
          databases and anonymous user created by default.  This is
          strongly recommended for production servers.

          See the manual for more instructions.

          You can start the MySQL daemon with:
          cd /usr/local/mysql ; /usr/local/mysql/bin/mysqld_safe &

          You can test the MySQL daemon with mysql-test-run.pl
          cd /usr/local/mysql/mysql-test ; perl mysql-test-run.pl

          Please report any problems with the /usr/local/mysql/bin/mysqlbug script!

           

          posted on 2006-05-05 16:22 強強 閱讀(874) 評論(0)  編輯  收藏 所屬分類: mysql

          主站蜘蛛池模板: 晋城| 榆树市| 桐城市| 白银市| 顺平县| 灵宝市| 兰州市| 措勤县| 大田县| 本溪市| 建水县| 麻栗坡县| 武夷山市| 会东县| 白朗县| 增城市| 井研县| 衡南县| 宁远县| 南平市| 邻水| 长顺县| 新干县| 高安市| 饶阳县| 兴业县| 镇江市| 黔西| 德庆县| 崇礼县| 淄博市| 前郭尔| 上蔡县| 家居| 克东县| 正安县| 绥棱县| 文登市| 六枝特区| 阿合奇县| 本溪市|