mysql build and setup on linux
来源:互联网 发布:美国囧哥百货 淘宝 编辑:程序博客网 时间:2024/06/11 02:16
Download MySQL Source Code from http://dev.mysql.com/downloads/
shell> groupadd mysql
shell> useradd -g mysql mysql
shell> gunzip < mysql-VERSION.tar.gz | tar -xvf -
shell> cd mysql-VERSION
shell> ./configure --prefix=/usr/local/mysql
shell> make
shell> make install
shell> cp support-files/my-medium.cnf /etc/my.cnf
shell> cd /usr/local/mysql
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> bin/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql var
shell> bin/mysqld_safe --user=mysql &
----
yum install ncurses-devel
yum install gcc gcc-c++
libxml2-devel
libxml2-utils
make clean
Follow this command by typing;
#./configure --prefix=/usr/local/mysql --localstatedir=/home/system/data/mysql --disable-maintainer-mode --with-mysqld-user=mysql --enable-large-files-without-debug (enter)
Sit back and wait for a while while configure does its thing, once the system returns the prompt to you issue the following command;
#make (enter)
Unless you have a very fast machine this will take some time, so spend time with your family, grab a beer, go for a walk, or whatever you're into. When you get back, assuming the system has returned the prompt to you issue the following command;
#make install (enter)
Cool !, MySQL is installed, there are only a couple things left to do to get it working, first we need to create a group for MySQL as follows;
#/usr/sbin/groupadd mysql (enter)
Then we create a user called mysql which belongs to the mysql group;
#/usr/sbin/useradd -g mysql mysql (enter)
Now we install the database files as follows;
#./scripts/mysql_install_db (enter)
Then we make a couple minor ownership changes;
# chown -R root:mysql /usr/local/mysql (enter)
# chown -R mysql:mysql /usr/local/mysql/data (enter)
Last but not least, we use vi to add a line the ld.so.conf file as follows;
#vi /etc/ld.so.conf
And we add the following line;
/usr/local/mysql/lib/mysql
Thats it, MySQL is installed, you can run it by issuing the following command;
#/usr/local/mysql/bin/mysqld_safe --user=mysql &
And as long as we're here we might as well set a root password for MySQL as follows;
#/usr/local/mysql/bin/mysqladmin -u root password new_password
Where new_password is the password you want to use.
Starting Apache and MySQL Automatically -
Lets start with MySQL, as root make your working directory that of the MySQL source directory you worked with earlier, something similar to;
#cd /home/xxxx/mysql-4.0.16
Then, copy the file mysql.server to your /etc/init.d directory as follows;
#cp support-files/mysql.server /etc/init.d/mysql
Ok, lets create some links in the startup folders for run levels 3 and 5.
#cd /etc/rc3.d
#ln -s ../init.d/mysql S85mysql
#ln -s ../init.d/mysql K85mysql
#cd /etc/rc5.d
#ln -s ../init.d/mysql S85mysql
#ln -s ../init.d/mysql K85mysql
#cd ../init.d
#chmod 755 mysql
Thats it for MySQL, it should start automatically now when you reboot your machine.
- mysql build and setup on linux
- Build Git service on Linux and setup Git client on Windows
- WebRTC Setup and Build
- WebRTC Setup And Build(2)
- Build Your Own RAC Cluster on Linux and FireWire
- How to build and install Open vSwitch on a linux
- build skia on linux
- Setup Apache, PHP, MySQL and WordPress on Mac OS X 10.8.3
- MySQL Install and Config on Linux.
- Setup SSH and SVN on Windows Server
- setup and configure ganglia on CentOS
- Setup LVS and Keepalived on Debian
- Three Common Problems during Domino Setup and Start on Linux/Unix
- Simple Firefox build On Linux
- linux build ruby on rails
- httpd2.6.16 build on linux
- How to install and setup Tor on Kali Linux 2.0(如何在Kali Linux 2.0 下安装 Tor)
- Installing LAMP (Linux, Apache, MySQL and PHP) On Linux
- unix时间值转指定格式的时间串
- Android下Xml解析技术(四)、pull生成Xml文件
- 利用OSGi开发WEB应用
- 一个查看Http数据工具
- 面试题整理-C++ 序列化对象
- mysql build and setup on linux
- zip4j -- Java处理zip压缩文件的完整解决方案
- bat win7 检测程序是否已管理员身份运行
- javascript var
- JavaScript中的Timer是怎么工作的
- 图文介绍Android环境搭建详细步骤
- 从远程服务器下载文件到本地服务器
- PHP程序编写规则
- Java中的static块