In case you’re using a Linux distribution that doesn’t support RPM, you can also install MySQL using a binary tarball from the MySQL web site. Installing from a binary distribution essentially means that you need to perform the installation steps manually rather than letting RPM automatically take care of it for you. Here’s how you go about doing it: 1. Ensure that you’re logged in as root:
2. Extract the content of the tarball to an appropriate directory on your system--I’ll assume this location is /usr/local/. Remember to replace the file name in italics with the file name of your tarball.
The MySQL files should get extracted into a directory named according to the format mysql-version-os-architecture--for example, mysql-standard-4.0.9-gamma-pc-linux-i686. 3. Now you’ll notice that the directory created in the previous step has a somewhat long and cumbersome directory name--something like mysql-standard-4.0.9-gamma-pc-linux-i686. For ease of use, create a soft link to this directory named mysql in the same location.
4. Change into this directory, and take a look at how the files are arranged. You should see something like Figure 3. (Take a look at the sidebar entitled “Up a Tree” for more information on what each directory contains.)
5. The MySQL database server can run as either the system root user or any other user on the system. From the security point of view, it’s considered a bad idea to run the MySQL database server as root ; hence, it becomes necessary for you to create a special mysql user and group for this purpose. You can accomplish this using the groupadd and useradd commands:
6. Run the initialization script, mysql_install_db, that ships with the program:
Figure 4 demonstrates what you should see when you do this.
As you can see from the output in the figure, this initialization script prepares and installs the various MySQL base tables and also sets up default access permissions for MySQL. 7. Alter the ownership of the MySQL binaries so that they are owned by root:
8. Now ensure that the newly-minted mysql user has read/write access to the MySQL data directories:
9. Start the MySQL server by manually running the mysqld daemon:
MySQL should start up normally, reading the base tables created in /usr/local/mysql/data. Once installation has been successfully completed, you can skip to the section titled “Testing MySQL,” later in this chapter, to verify that your server is functioning properly.
blog comments powered by Disqus |
|
|
|
|
|
|
|