how to install MySQL in fedora linux or ubuntu linux

11:06 AM
Download mysql-max-4.0.17-pc-linux-i686.tar.gz from one of the mysql mirrors at


Key fingerprint = AF19 FA27 2F94 998D FDB5 DE3D F8B5 06E4 A169 4E46.


http://www.mysql.com.


These instructions can be found in the file called INSTALL-BINARY in the downloaded
file.


# groupadd -g 49 mysql
# useradd -c "MySQL Server" -d /usr/mysql -g 49 -s /sbin/nologin -u 49 mysql
# mv mysql-max-4.0.17-pc-linux-i686.tar.gz /usr
# cd /usr/
# tar xvzf mysql-max-4.0.17-pc-linux-i686.tar.gz
# ln -sf /usr/mysql-max-4.0.17-pc-linux-i686 /usr/mysql
# cd mysql


# scripts/mysql_install_db
# chown -R root .
# chown -R mysql data
# chgrp -R mysql .
# bin/mysqld_safe --user=mysql &
Copy the initialization script to the correct location
# cp support-files/mysql.server /etc/init.d/mysqld
# chown 0.0 /etc/init.d/mysqld
# chmod 700 /etc/init.d/mysqld
# vi +47 /etc/init.d/mysqld
Change line:
datadir=/usr/local/mysql/data
to
datadir=/usr/mysql/data
# vi +51 /etc/init.d/mysqld
Change line:
basedir=/usr/local/mysql
to
basedir=/usr/mysql
# vi +117 /etc/init.d/mysqld
Change line:
if test "$datadir" != "/usr/local/mysql/data"
to
if test "$datadir" != "/usr/mysql/data"
# chkconfig --add mysqld
17
Key fingerprint = AF19 FA27 2F94 998D FDB5 DE3D F8B5 06E4 A169 4E46.
# vi +148 /etc/init.d/mysqld
Change line:
$bindir/mysqld_safe --datadir=$datadir --pid-file=$pid_file >/dev/null 2>&1 &
to
$bindir/mysqld_safe --datadir=$datadir --pid-file=$pid_file --user=mysql >/dev/null 2>&1 &
# cp /usr/mysql/support-files/my-medium.cnf /etc/my.cnf
Under the support-files directory you find several other .cnf files (small, large and huge)
that can be used. The my-medium.cnf file is intended for a server which is running other
services besides MySQL. You'd want to use huge or large if a pure mysql server.
# vi +36 /etc/my.cnf
Add the following:
set-variable=local-infile=0
By default MySQL listens on port 3306. We do not need this as we will not be connecting
to MySQL from other servers. Stop MySQL from listening on any TCP/IP port:
# vi +44 /etc/my.cnf
Change
#skip-networking
to
#skip-networking

0 Comments