|
|||||
| | |||||
|
There are a few steps in getting up and running with the server. You need of course to first to install the server from source/binary. Then, you will have to figure out why it keeps dying right after you start it. Help for these steps comes from the manual which comes with the distribution and also is avaliable at their web site, www.mysql.org; the web site has a searchable version which can be helpful.
After the server is installed, you will be able to communicate with the server in a few different ways. Remote users and client GUIs can communicate via TCP/IP port (default port is 3306). Users comfortable with command line SQL may communicate with the server via the mysql command-line utility. This can be invoked with "mysql". Another way to communicate with the server is via the mysqladmin utility.
In choosing to install a linux server you will have to do some configuration at the onset. After the setup, then finally you can worry about SQL syntax and commands.
the following are the rpm I put on the redhat: mysqlclient10-3.23.22-4, mysql-3.23.36-1, mysql-server-3.23.36-1, mysql-devel-3.23.36-1. the server is not included in the mysql package, then.
After installing MySQL, you set up the initial access privileges by running scripts/mysql_install_db.
permissions must be set up as documented at mysql.com
you need then, after setting permissions, run 'mysql_install_db'
then, do safe_mysqld
you need to run /bin/safe_mysqld this to start and stop the database server, after installing the mysql databases.
safe_mysqld is a bash shell script which controls the MySQL
daemon. Use "locate safe_mysqld" to find it, that is, unless you just
unpackaged and unzipped because that such a new file won't yet be in the locate
database. On this RedHat system, it is in /usr/bin so can be started by typing
the name. It takes no arguments, and starts the daemon.
it's a long shell script
instead of invoking mysqld diretctly, if this script is used, safe_mysqld will restart it if it crashes
to use safe_mysqld, it takes some arguments: to see what your defaults are it's bin/my_print_defaults --config-file=my client mysql which assumes my.cnf is in its default location.
[root@www2 mysql2]# bin/my_print_defaults --defaults-extra-file=etc/my.cnf --config-file=my client mysql --password=crazyboy333 --port=3306 --socket=/var/lib/mysql/mysql.sock [root@www2 mysql2]#
these values are from /etc/my.cnf.
from some
guy's web site, deal with the problem I got every single time I
reinstalled: "cannot connect through socket tmp.mysql."
You have to set an environment variable.
first, verify the daemon is really running with a mysqladmin
ping.
you can connect to the running daemon with the mysql command-utility.
when you first started the daemon you ran mysql_install_db. This should set up an access table for you. When you first start up the daemon you will use the --skip-grant-tables option. This option " causes the server not to use the privilege system at all. This gives everyone full access to all databases!
you are greeted during the installation of mysql_install_db with a reminder to change the root password.
It is best to add a user's password with the mysqladmin utility: /usr/bin/mysqladmin -u root -h first.sirfsup.com -p password 'new-password'
. Do not enter the password as plain-text, as the password in the database is encrypted using the PASSWORD(secret) function. If you try to use SQL to add the password you may encounter some difficulties. the syntax should be UPDATE user SET Password=PASSWORD('new_password') WHERE USER= 'joe_shmoe'.
after adding a user with mysqladimin, start the mysql daemon and edit the permissions for the user with sql commands.
modifying the grant tables, the columns are pretty self-explanatory. You can give users grant access, which means they can give their rights to others. Also, you can specify if they require a password to connect.
If you modify the grant tables manually (using INSERT, UPDATE, etc.), you should execute a FLUSH PRIVILEGES statement or run mysqladmin flush-privileges or mysqladmin reload. These commands tell the server to reload the grant tables. Otherwise your changes will have no effect until you restart the server. If you change the grant tables manually but forget to reload the privileges, you will be wondering why your changes don't seem to make any difference! However, "Modifications to the grant tables that you perform using GRANT, REVOKE, or SET PASSWORD are noticed by the server immediately". Otherwise, when the server notices that the grant tables have been changed, existing client connections are affected as follows:
USE db_name command.
Global privilege changes and password changes take effect the next time the client connects.
also see the section below on mysqlaccess which is a script which checks permissions.
[root@www2 mysql-4.0.9-gamma]# ./configure --with-tcp-port=3307 --with-unix-socket-path=/usr/local/mysql-4.0.9/data --prefix=/usr/local/mysql-4.0.9
| Leave a Reply |