Unix Postinstallation Procedures
133
Address already in use
Can't start server: Bind on unix socket...
For instructions on setting up multiple servers, see
Section 5.3, “Running Multiple MySQL Instances
on One Machine”
.
• You do not have write access to the
/tmp
directory
If you do not have write access to create temporary files or a Unix socket file in the default location
(the
/tmp
directory), an error occurs when you run
mysql_install_db
or the
mysqld
server.
You can specify different locations for the temporary directory and Unix socket file by executing
these commands prior to starting
mysql_install_db
or
mysqld
, where
some_tmp_dir
is the full
path name to some directory for which you have write permission:
shell>
TMPDIR=/some_tmp_dir/
shell>
MYSQL_UNIX_PORT=/some_tmp_dir/mysql.sock
shell>
export TMPDIR MYSQL_UNIX_PORT
Then you should be able to run
mysql_install_db
and start the server with these commands:
shell>
bin/mysql_install_db --user=mysql
shell>
bin/mysqld_safe --user=mysql &
If
mysql_install_db
is located in the
scripts
directory, modify the first command to
scripts/
mysql_install_db
.
See
Section C.5.4.5, “How to Protect or Change the MySQL Unix Socket File”
, and
Section 2.21,
“Environment Variables”
.
There are some alternatives to running the
mysql_install_db
script provided in the MySQL
distribution:
• If you want the initial privileges to be different from the standard defaults, you can modify
mysql_install_db
before you run it. However, it is preferable to use
GRANT
and
REVOKE
to change the privileges after the grant tables have been set up. In other words, you can run
mysql_install_db
, and then use
mysql -u root mysql
to connect to the server as the
MySQL
root
user so that you can issue the necessary
GRANT
and
REVOKE
statements.
If you want to install MySQL on several machines with the same privileges, you can put the
GRANT
and
REVOKE
statements in a file and execute the file as a script using
mysql
after running
mysql_install_db
. For example:
shell>
bin/mysql_install_db --user=mysql
shell>
bin/mysql -u root < your_script_file
By doing this, you can avoid having to issue the statements manually on each machine.
• It is possible to re-create the grant tables completely after they have previously been created. You
might want to do this if you are just learning how to use
GRANT
and
REVOKE
and have made so many
modifications after running
mysql_install_db
that you want to wipe out the tables and start over.
To re-create the grant tables, remove all the
.frm
,
.MYI
, and
.MYD
files in the
mysql
database
directory. Then run the
mysql_install_db
script again.
• You can start
mysqld
manually using the
--skip-grant-tables
[420]
option and add the
privilege information yourself using
mysql
:
shell>
bin/mysqld_safe --user=mysql --skip-grant-tables &
shell>
bin/mysql mysql
From
mysql
, manually execute the SQL commands contained in
mysql_install_db
. Make sure
that you run
mysqladmin flush-privileges
or
mysqladmin reload
afterward to tell the
server to reload the grant tables.
Summary of Contents for 5.0
Page 1: ...MySQL 5 0 Reference Manual ...
Page 18: ...xviii ...
Page 60: ...40 ...
Page 396: ...376 ...
Page 578: ...558 ...
Page 636: ...616 ...
Page 844: ...824 ...
Page 1234: ...1214 ...
Page 1427: ...MySQL Proxy Scripting 1407 ...
Page 1734: ...1714 ...
Page 1752: ...1732 ...
Page 1783: ...Configuring Connector ODBC 1763 ...
Page 1793: ...Connector ODBC Examples 1773 ...
Page 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Page 2850: ...2830 ...
Page 2854: ...2834 ...
Page 2928: ...2908 ...
Page 3000: ...2980 ...
Page 3122: ...3102 ...
Page 3126: ...3106 ...
Page 3174: ...3154 ...
Page 3232: ...3212 ...