NetAdminTools.com
 
SignalQ Sites:
NetAdminTools - Coprolite - NoNIC - SpotBridge - NAW
RoboCoop - AreWeDown - SolarPower - SysAdminTools
Xfig - Gold Loaf - GeekPapa - FixGMC - MCJ - FixRambler
Categories:
GNU/Linux | Homebrew designs | Perl | Administration | Backup/Recovery | Bugs/Fixes | Certification | Database | Email | File/Print | Hardware | Information Grab Bag | Interoperability | GNU/Linux ABCs | Monitoring | Name Resolution | Network Services | Networking | Remote Control | Security | Desktop | Web | BSD | Solaris | GIAGD | REALbasic

Last 30 Days | Last 60 Days | Last 90 Days | All Articles | RSS


Categories:
·GNU/Linux
·Homebrew designs
·Perl
·Administration
·Backup/Recovery
·Bugs/Fixes
·Certification
·Database
·Email
·File/Print
·Hardware
·Information Grab Bag
·Interoperability
·GNU/Linux ABCs
·Monitoring
·Name Resolution
·Network Services
·Networking
·Remote Control
·Security
·Desktop
·Web
·BSD
·Solaris
·GIAGD
·REALbasic
·All Categories


MySQL installation and initial configuration
Topic: Database   Posted:2001-08-12
Printer Friendly: Print

spacerspacer
Uncompress the source:
[src]# tar -xzf mysql-3.23.40.tar.gz
Change to mysql source root, and add mysql group and user:
[src]# cd my*
[mysql-3.23.40]# groupadd mysql
[mysql-3.23.40]# useradd -g mysql mysql
Run configure, specifying installation directory as /usr/local/mysql:
[mysql-3.23.40]# ./configure --prefix=/usr/local/mysql
creating cache ./config.cache
checking host system type... i586-pc-linux-gnu
.
.
.
Remember to check the platform specific part in the reference manual for
hints about installing on your platfrom. See the Docs directory.
Thank you for choosing MySQL!
Run make, make install:
[mysql-3.23.40]# make
cd include; make link_sources
make[1]: Entering directory `/usr/local/src/mysql-3.23.40/include'
.
.
.
make[2]: Nothing to be done for `all-am'.
make[2]: Leaving directory `/usr/local/src/mysql-3.23.40'
make[1]: Leaving directory `/usr/local/src/mysql-3.23.40'
[mysql-3.23.40]#
[mysql-3.23.40]# make install
Making install in include
make[1]: Entering directory `/usr/local/src/mysql-3.23.40/include'
.
.
.
make[2]: Leaving directory `/usr/local/src/mysql-3.23.40'
make[1]: Leaving directory `/usr/local/src/mysql-3.23.40'
[mysql-3.23.40]#
Let's create the MySQL grant tables:
[mysql-3.23.40]# scripts/mysql_install_db
Preparing db table
Preparing host table
.
.
.
Support MySQL by buying support/licenses at https://order.mysql.com
[mysql-3.23.40]#
Let's change some permissions:
[mysql-3.23.40]# chown -R root /usr/local/mysql
[mysql-3.23.40]# chown -R mysql /usr/local/mysql/var
[mysql-3.23.40]# chgrp -R mysql /usr/local/mysql
Copy a a configuration file to start with:
[mysql-3.23.40]# cp support-files/my-medium.cnf /etc/my.cnf
Let's start up the MySQL daemon:
[ /root]# /usr/local/mysql/bin/safe_mysqld &
[1] 31730
[/root]# Starting mysqld daemon with databases from /usr/local/mysql/var
[/root]#
Let's set a password for MySQL root user:
[mysql]# /usr/local/mysql/bin/mysqladmin -u root -p password 'password'
Enter password:
[mysql]#
[mysql]# /usr/local/mysql/bin/mysqladmin -u root -h srv-33.signalq.com -p password 'password'
Enter password:
[mysql]#
Note that the existing password is blank, and, of course, you should replace password with your favorite password. :)

Let's check the version:

 [root@srv-33 mysql]# /usr/local/mysql/bin/mysqladmin version -p
Enter password:
/usr/local/mysql/bin/mysqladmin  Ver 8.21 Distrib 3.23.40, for pc-linux-gnu on i586
Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license
Server version          3.23.40-log
Protocol version        10
Connection              Localhost via UNIX socket
UNIX socket             /tmp/mysql.sock
Uptime:                 37 min 3 sec
Threads: 1  Questions: 10  Slow queries: 0  Opens: 7  Flush tables: 1  Open tables: 1 Queries per second avg: 0.004
[mysql]#
There is a script in mysql-test called mysql-test-run that will run extensive tests. Modify the path in the script to include /usr/local/mysql/bin, and run:
[mysql-test]# ./mysql-test-run
Installing Test Databases
Removing Stale Files
Installing Master Databases
010801  0:41:57  ../sql/mysqld: Shutdown Complete
Installing Slave Databases
010801  0:41:58  ../sql/mysqld: Shutdown Complete
Starting MySQL daemon
Loading Standard Test Databases
Starting Tests
TEST                         USER   SYSTEM  ELAPSED        RESULT
------------------------------------------------------------------------
alias                         0.49     0.24     1.30       [ pass ]
alter_table                   0.10     0.13     0.39       [ pass ]
.
.
.
variables                     0.10     0.12     0.23       [ pass ]
warnings                      0.15     0.07     0.25       [ pass ]
------------------------------------------------------------------------
Ending Tests
Shutting-down MySQL daemon
Master shutdown finished
Slave shutdown finished
All 125 tests were successful.
[mysql-test]#
Add the following to /etc/rc.local to start MySQL automatically:
/usr/local/mysql/share/mysql/mysql.server start
You could use many methods for this, but rc.local is more generic.

We also need to add these lines to /etc/my.cnf:

[mysql.server]
basedir=/usr/local/mysql
And under the [mysqld] section in /etc/my.cnf:
datadir         = /usr/local/mysql/var
user            = mysql
Here is how we tweaked the module config on webmin to manage our MySQL server.

Check out our BIND Automation page for more info on webmin.

Here is what the webmin MySQL manager screen looks like.

We have a database server. Rejoice!





Please read our Terms of Use and our Privacy Policy
Microsoft, Windows, Windows XP, Windows 2003, Windows 2000, and NT are either trademarks or registered trademarks of Microsoft Corporation. NetAdminTools.com is not affiliated with Microsoft Corporation. Linux is a registered trademark of Linus Torvalds, and refers to the Linux kernel. The operating system of most distributions that contain the Linux kernel is GNU/Linux. All logos and trademarks in this site are property of their respective owner. Copyright 1997-2009 NetAdminTools.com

Created by:
MCJ
MCJ CMS