1

I've changed my.ini with port=3308 but after restart the service mysql 5.6 is working in the same default port 3306.

I've tried in mysql 5.5 and it worked fine.

C:\Archivos de programa\MySQL\MySQL Server 5.6

my.ini

# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.

[mysqld]

# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M

# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin

# These are commonly set, remove the # and set as required.
# basedir = .....
# datadir = .....
port = 3309
# server_id = .....

What am I missing? Is there any bug?

EDIT BY @RolandoMySQLDBA

Please run the following

cd C:\Archivos de programa\MySQL\MySQL Server 5.5
dir
cd C:\Archivos de programa\MySQL\MySQL Server 5.6
dir

and post the output in this question

2
  • it seems to be the path where mysql reads my.ini, now in version 5.6, it seems to be changed
    – Joe
    Jun 17, 2014 at 13:42
  • And it has nothing to do with mysql workbench configuration connection, they are completly independent
    – Joe
    Jun 17, 2014 at 13:43

2 Answers 2

1

you need to make sure the correct my.ini is edited, you can check it from windows services by opening MySQL properties and make sure it is related to MySQL 5.6. now you need to stop the service then open the ini file in the service description and edit the port. finally start the service and try to log in from CMD using:

1) cd C:\Archivos de programa\MySQL\MySQL Server 5.6

2) mysql -uroot -Pport -ppassword

2
  • How do you make sure the my.ini file is using? I'm using 2 server with different ports in the same server
    – Joe
    Jun 18, 2014 at 8:01
  • 1
    you need to open the windows services and check MySQL SID service, lets say for example the name was MySQL (default service name unless you changed it) right click it, then open properties window find in the general tab path to executable: one line below you will see like the following: C:\program files\Mysql5.6\bin\mysqld --defaults-file=C:\program files\Mysql5.6\my.ini mysql, now you need to check (C:\program files\Mysql5.6\bin\mysqld) if the path is correct and the ini location from (C:\program files\Mysql5.6\my.ini) Jun 18, 2014 at 11:45
1

MySQL 5.6 my.ini file is in the path where the data is stored, in my case

C:\Documents and Settings\All Users\Datos de programa\MySQL\MySQL Server 5.6 

instead of the path where mysql is install

C:\Archivos de programa\MySQL\MySQL Server 5.6

, like older versions.

We have to change C:\Documents and Settings\All Users\Datos de programa\MySQL\MySQL Server 5.6 \my.ini file to the changes take effect, and restart the service.

On Windows, MySQL programs read startup options from the following files, in the specified order

enter image description here

More info Using options files


Modifying Registry

As well it is possible to do it in the registry with regedit command

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services

and change binPath


MySQL commands

You can see configuration options through the following command and look up 'Default options' to see the paths where configuration .ini and .cnf are.

> mysqld --verbose --help

And with this other command you can see mysql variables

> mysqladmin variables

Command line

You can also see the default my.ini file that mysql is using by looking at the service properties, in executable path on option --defaults-file.

It is possible to change service through command line You can use the sc config command to change the path a service points to:

SC CONFIG YourServiceName binPath= "C:\SomeDirectory\YourFile.EXE"

This will update the service called YourServiceName and change the "Path to Executable" entry to C:\SomeDirectory\YourFile.EXE. You will want to restart your service afterwards, which you can do with:

NET STOP YourServiceName & NET START YourServiceName

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.