Learning Mysql



Download 4.24 Mb.
View original pdf
Page51/366
Date04.08.2023
Size4.24 Mb.
#61806
1   ...   47   48   49   50   51   52   53   54   ...   366
Learning MySQL
48 | Chapter 2:
Installing MySQL

are typically used by other common programs. For instance, port 8080 is often used by web servers and proxies. A web search for common ports is a good way to learn about these. Note that only the root user can allocate port numbers below 1024. We’ll use the port number 57777 for our example.
You also need to specify a custom location for the socket file this is a special type of file used by clients to connect to a server on the same machine. A common choice fora socket file location is the server data directory we’ll use the file path
/mysql/data/

mysql.sock in the following example.
Now, start the server using the nonstandard port and socket file bin/mysqld_safe -port --socket=
/mysql/data/mysql.sock &

Note that if you’re using a nonstandard MySQL installation directory and don’t start the server from inside that directory, you have to specify the path to the mysqld_safe program and tell this program where the data directory is. For example, to run the program from the
/mysql/bin
directory with the data directory
/mysql/data
, you would type (all on one line
/mysql/bin/mysqld_safe \

-port \
--socket=
/mysql/data/mysql.sock \

--datadir=
/mysql/data &

Now that the server is running, set a password for the database root account by typing bin/mysqladmin \
-port \
--socket=
/mysql/data/mysql.sock \

--user=root \
password the_new_mysql_root_password
Once you’ve added a password for the database root user, you’ll have to use it for all further client connections to the server for the root account.
You can stop the server using the mysqladmin shutdown command, with the necessary options added to identify the server. Type all on one line bin/mysqladmin \
-port \

Download 4.24 Mb.

Share with your friends:
1   ...   47   48   49   50   51   52   53   54   ...   366




The database is protected by copyright ©ininet.org 2024
send message

    Main page