Mysql Installation
install with source
download mysql-5.0.51b.tar.gz source from mysql home page
./configure --prefix=/usr/local \
--localstatedir=/usr/local/mysql/data
make install
install with compiled binary
download binary from mysql homepage
#download from official site
rpm -Uvh MySQL-server-5.5.24-1.linux2.6.x86_64.rpm
Preparing... ########################################### [100%]
1:MySQL-server ########################################### [100%]
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h td-hcom01 password 'new-password'
Alternatively you can run:
/usr/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.
Please report any problems with the /usr/bin/mysqlbug script!
Notes regarding SELinux on this platform:
=========================================
The default policy might cause server startup to fail because it is
not allowed to access critical files. In this case, please update
your installation.
The default policy might also cause inavailability of SSL related
features because the server is not allowed to access /dev/random
and /dev/urandom. If this is a problem, please do the following:
1) install selinux-policy-targeted-sources from your OS vendor
2) add the following two lines to /etc/selinux/targeted/src/policy/domains/program/mysqld.te:
allow mysqld_t random_device_t:chr_file read;
allow mysqld_t urandom_device_t:chr_file read;
3) cd to /etc/selinux/targeted/src/policy and issue the following command:
make load
[root@td-hcom01 altspkgs]# rpm -Uvh MySQL-client-5.5.24-1.linux2.6.x86_64.rpm
Preparing... ########################################### [100%]
1:MySQL-client ########################################### [100%]
Preparing... ########################################### [100%]
1:MySQL-devel ########################################### [100%]
[root@td-hcom01 altspkgs]# rpm -Uvh MySQL-shared-5.5.24-1.linux2.6.x86_64.rpm
Preparing... ########################################### [100%]
1:MySQL-shared ########################################### [100%]
[root@td-hcom01 altspkgs]# rpm -Uvh MySQL-test-5.5.24-1.linux2.6.x86_64.rpm
Preparing... ########################################### [100%]
1:MySQL-test ########################################### [100%]
[root@td-hcom01 altspkgs]# rpm -Uvh MySQL-embedded-5.5.24-1.linux2.6.x86_64.rpm
Preparing... ########################################### [100%]
1:MySQL-embedded ########################################### [100%]
extract and setup
shell> groupadd mysql
shell> useradd -g mysql mysql
shell> cd /usr/local
shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf -
shell> ln -s full-path-to-mysql-VERSION-OS mysql
shell> cd mysql
shell> scripts/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql data
shell> chgrp -R mysql .
start the server
shell> bin/mysqld_safe --user=mysql &
test
shell> bin/mysqladmin version
shell> bin/mysqladmin variables
bin/mysqlshow
shutdown
bin/mysqladmin -u root shutdown
set root password
shell> mysql -u root
mysql> SET PASSWORD FOR ''@'localhost' = PASSWORD('the password');
mysql> SET PASSWORD FOR ''@'host_name' = PASSWORD('the password');