www.databasejournal.com/features/mysql/article.php/1383591
January 3, 2002 MySQL is freely available for Linux from
http://www.mysql.com (or one of
its mirrors listed at
http://www.mysql.com/downloads/mirrors.html). Download the latest
stable release (listed as "recommended" on the download page).
You should grab the "Tarball" version under "Source downloads",
with filename With the program downloaded (it was about 10.5MB as of this
writing), you should make sure you're logged in as
Next, you need to configure the MySQL install. Unless you really
know what you're doing, all you should have to do is tell it
where to install. I recommend
After sitting through the screens and screens of configuration tests, you'll eventually get back to a command prompt. Be sure the configuration completed successfully. If you see an error message just before the configuration quit, you'll need to address the problem it's complaining about. On Mandrake 8.0, for example, it complained of "No curses/termcap library found". I simply installed the 'libncurses5-devel' package in Mandrake's Software Manager, and the configuration worked fine on a second attempt. Once configuration is complete, you're ready to compile MySQL:
After even more screens of compilation (this could take as long as a half an hour on some systems), you'll again be returned to the command prompt. You're now ready to install your newly compiled program:
MySQL is now installed, but before it can do anything useful its database files need to be installed too. Still in the directory you installed from, type the following command:
With that done, you can delete the directory you've been working in, which just contains all the source files and temporary installation files. If you ever need to reinstall, you can simply re-extract the mysql-version.tar.gz file. With MySQL installed and ready to store information, all that's left is to get the server running on your computer. While you can run the server as the root user, or even as yourself (if, for example, you installed the server in your own home directory), the best idea is to set up on the system a special user whose sole purpose is to run the MySQL server. This will remove any possibility of someone using the MySQL server as a way to break into the rest of your system. To create a special MySQL user, you'll need to log in as root and type the following commands: % /usr/sbin/groupadd mysqlgrp % /usr/sbin/useradd -g mysqlgrp mysqlusr By default, MySQL stores all database information in the var
subdirectory of the directory to which it was installed. We want
to make it so that nobody can access that directory except our
new MySQL user. Assuming you installed MySQL to the
Now everything's set for you to launch the MySQL server for the first time. From the MySQL directory, type the following command:
If you see the message 'mysql daemon ended', then the MySQL
server was prevented from starting. The error message should have
been written to a file called
If the MySQL server was launched without complaint, the server will run (just like your Web or FTP server) until your computer is shut down. To test that the server is running properly, type the following command:
A little blurb with some statistics about the MySQL server should
be displayed. If you receive an error message, something has gone
wrong. Again, check the
If you want your MySQL server to run automatically whenever the
system is running (just like your Web server probably does),
you'll have to set it up to do so. In the
First of all, assuming you've set up a special MySQL user to run
the MySQL server, you'll need to tell the MySQL server to start
as that user by default. To do this, create in your system's
Now, when you run Setting up your system to run the script at startup is a highly operating system-dependant task. If you're not sure of how to do this, you'd be best to ask someone who knows. However the following commands (starting in the MySQL directory) will do the trick for most versions of Linux:
NOTE: Under the current SUSE distribution of Linux, there is no
That's it! To test that this works, reboot your system and request the status of the server as before. One final thing you might like to do for convenience sake, is to
place the MySQL client programs, which you'll use to administer
your MySQL server later on, in the system path. To this end, you
can place symbolic links to
|
| Go to page: Prev 1 2 3 4 5 6 7 8 9 10 Next |
|
|
|
|
|
|