Home >> FAQs/Tutorials >> MySQL Tutorials >> Index

MySQL FAQs - Server Daemon mysqld Administration

By: FYIcenter.com

Part:   1  2  3  4  

(Continued from previous part...)

How To Run MySQL Server on a Different Port?

By default, MySQL will listen at port number 3306 for any client connections. But you can change this by starting the server with "--port=portNumber" option. The tutorial exercise shows you how to start the server to listen to a different port number:

>cd \mysql\bin
>mysqld --log=\mysql\logs\query.log 
 --log-bin=\mysql\logs\binary.log 
 --log-error=\mysql\logs\error.log --console --port=8888

21:30:33  InnoDB: Started; log sequence number 0 43665
21:30:33 [Note] mysqld: ready for connections.
Version: '5.0.24-community-log'  socket: ''  port: 8888 
 MySQL Community Edition (GPL)

How To Connect to MySQL Server on a Different Port?

If your MySQL server is listening on port number different than 3306, you need to specify "--port=portNumber" option to any client program that needs to connect to the server. The tutorial exercise shows you how to connect "mysql" to start the server to listen to a different port number:

\mysql\bin\mysql -u root -pretneciyf --port=8888 test
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 5.0.24

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

Part:   1  2  3  4  


Selected Developer Jobs:

More...