大鳥的學(xué)習(xí)樂園
          路漫漫其修遠(yuǎn)兮,吾將上下而求索
          posts - 26,comments - 27,trackbacks - 0

          MySql安裝包

             進(jìn)入到安裝包的保存路徑后,下面的命令進(jìn)行解(位置: ../bulid/)

                 tar zxvf mysql-5.1.53.tar.gz -C ../bulid/

           

            編譯

             進(jìn)入到解后的文件

             安裝mysql前需要安裝一些linux統(tǒng)軟

                 aptitude install lib64ncurses5-dev OR libncurses5-dev

                aptitude install g++           

                aptitude install automake           

                aptitude install autoconf2.13           

                autoreconf --force --install           

                aclocal; autoheader           

                libtoolize --automake --force           

                automake --force --add-missing; autoconf                        

             編譯MySql,安裝到/usr/local/mysql-5.1.53

                ./configure '--prefix=/usr/local/mysql-5.1.53' '--with-mysqld-user=mysql' '--with-extra-charsets=all' '--with-named-curses-libs=/lib/libncurses.so.5' '--enable-assembler' '--with-charset=utf8'

                make

           

            ③安裝

                 make install

           

            ④添加權(quán)

                 groupadd mysql

                useradd mysql -g mysql

                ./scripts/mysql_install_db --user=mysql

           

                :

                   mysql_install_db現(xiàn)FATAL ERROR: Could not find mysqld錯誤時

                    /etc/mysql/下出現(xiàn)了個my.cnf

                   解決方法:

                     mv  /etc/mysql/my.cnf   /etc/mysql/my.cnf.bak

                     cp  support-files/my-medium.cnf   /etc/cnf

                 cd /usr/local/mysql-5.1.53/   

                 chown -R root .   

                 chown -R mysql var   

                 chown -R mysql var/.   

                 chown -R mysql var/mysql/.   

                 chgrp -R mysql .   

           

            ⑤運(yùn)行并看是否安裝成功

                  /usr/local/mysql-5.1.39/bin/mysqld_safe --user=mysql &

                 lsof -i:3306 --3306端口是否是mysql在運(yùn)行。

                 ./bin/mysql -root

                 exit --退出mysql

           

            ⑥修改mysql

                 /usr/local/mysql-5.1.53/bin/mysqladmin -uroot password root 

                ./bin/mysql -uroot -p --再次登

                 root --

           

            ⑦添加人能夠訪問權(quán)

                GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;

                use mysql;           

                mysql> select User,host from user;           

                +------+-----------+           

                | User | host      |           

                +------+-----------+           

                | root | %         |           

                | root | 127.0.0.1 |           

                |      | camp      |           

                | root | camp      |           

                |      | localhost |           

                | root | localhost |           

                +------+-----------+           

                6 rows in set (0.00 sec)                           

           

             :編譯或安裝程中可能會因缺少某些文件而導(dǎo)error

                根據(jù)error提示的信息,先安裝缺少的文件再重新編譯安裝

                 error;

                  checking for termcap functions library... configure: error: No curses/termcap library found

                安裝install lib64ncurses5-dev錯誤就可避免

           

                 命令 「aptitude search 找內(nèi)容」找相應(yīng)的文件

           

          posted on 2012-01-18 21:48 大鳥 閱讀(585) 評論(0)  編輯  收藏 所屬分類: linux
          主站蜘蛛池模板: 宝应县| 石门县| 永和县| 诸城市| 拜城县| 台中县| 靖江市| 阳新县| 贵州省| 敖汉旗| 梁河县| 偏关县| 密山市| 怀仁县| 页游| 锦州市| 宁城县| 布尔津县| 杭锦旗| 香格里拉县| 嘉兴市| 建平县| 淳化县| 山阳县| 资溪县| 鸡泽县| 饶阳县| 汽车| 崇仁县| 湘潭县| 禹州市| 乌审旗| 龙海市| 天祝| 连江县| 光山县| 水城县| 剑阁县| 西充县| 广元市| 泸水县|