MySQL: how to set a different config file on Windows? - mysql

I did the following,
mysqld.exe --defaults-file="D:\my-large.ini"
I changed the max_allowed_packets inside of that .ini but I'm still receiving the error. How do I know that MySQL loaded that file?

You can check max_allowed_packets from the mysql prompt like so:
show variables like '%max_allowed%';

What worked for me was
1. start Mysql workbench 5.6
2. In the navigator go to Instance options file.
3. Click the networking
4. Enter 16M in the max_allowed_packet edit box, click apply and restart mysql
5. Show variables like 'max_allowed_packet' will now give 16777216

Related

MySQL lower_case_file_system change (OFF to ON)

I am trying to change the lower_case_file_system to 'ON' in MySQL, but do not know how to do it. I'd like to set it up as case-non-sensitive.
According to the MySQL 8.0 Reference Manual, 'This variable describes the case sensitivity of file names on the file system where the data directory is located. OFF means file names are case-sensitive, ON means they are not case-sensitive. This variable is read-only because it reflects a file system attribute and setting it would have no effect on the file system.'
How can I change the value? Any idea, please? Thanks!
Carolina
enter image description here
Assuming it's through XAMPP.
Do these steps:
open your MySQL configuration file: [drive]\xampp\mysql\bin\my.ini
look up for: # The MySQL server [mysqld]
add this right below it: lower_case_table_names = 2
save the file and restart MySQL service
From: http://webdev.issimplified.com/2010/03/02/mysql-on-windows-force-table-names-to-lowercase/
In order to use camelCaseNames in table names and views, lower_case_table_names has to be 0
Might want to check here too:
As per this link, lower_case_table_names should be set together with --initialize option.
If on Ubuntu:
https://bugs.mysql.com/bug.php?id=90695 this is not supported out of the box. So the workaround is this
lower_case_table_names=1 on Ubuntu 18.04 doesn't let mysql to start
Finally, read the official sources:
https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html
https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html
https://forums.mysql.com/read.php?10,377683
On Mysql Server 8.0 Windows os, if you change lower_case_table_names=2 in mysql.ini the server will not start so you have to follow this
step 1: Backup all data / export to .sql or Dump all data
step 2: Stop the server from service
step 3: Delete the data folder from C:\Program Files\ Mysql Server 8.0\Data
step 4: Open C:\Program Files\ Mysql Server 8.0\my.ini as an administrator using notepad
step: 5 find set lower_case_table_names= 2 if you want camelCase table name
step: 6 open mysql installer and open reconfigure then open ->show advanced and logging option -> Advanced Options -> use second option from the list
step: 7 then everything will be ok

"Packet for query is too large" error. Where to change max_allowed_packet variable?

I am having a problem, I imported a spring boot project from git, the code is working perfectly fine in my teammates computers, but I get an error That I don't know how to solve, while running my java application I get this error :
Packet for query is too large (1072729 > 1048576). You can change this value on the server by setting the max_allowed_packet' variable.
I read some answers about the subject, What I understood is that I have to make a change in my.ini file and change this value :
max_allowed_packet=500M
But it seems like I am unable to find my file location, I am working with MySQLWorkebench and I dont know where to find this file to make my change or any change.
Any help would be much appreciated.
You will find my.ini in either
32bit WAMPServer
C:\wamp\bin\mysql\mysqlx.y.z\my.ini
64bit WAMPServer
C:\wamp64\bin\mysql\mysqlx.y.z\my.ini
where mysqlx.y.z is the version of MySQL that you have installed. Remember there may be more than one version installed so check with the wampmanager icon menu which one is currently active
In my.ini under the section [wamp] or [wamp64] you will see the parameter
max_allowed_packet = 1M
Change that to the value you believe is required.
Remember to restart MySQL (using the wampmanager icon menus) after saving your change to my.ini

Changes to my.ini Not Persisting when using MySQL

I'm attempting to update some variables for my MySQL database server; I am running Maria version 10.3.12 on a Windows 10 64-bit laptop. I have attempted to update the my.ini file located here:
C:\Program Files\MariaDB 10.3\data\my.ini
I am adding the following lines to a rather simple my.ini
max_allowed_packet=64M
interactive_timeout=86400
wait_timeout=86400
I have saved the changes to the my.ini; but when I restart the database server using mysqld restart at the command console, and then log back into the client, I expect to see my changes using SHOW VARIABLES LIKE 'max%' and what I end up seeing is the default value. The default value for max_allowed_packet is about 16M and for the other two it is 28800.
There are numerous articles that relate to this; having poured over them I am aware of how to use the SET command to update these from within the client. My goal though is to make a permanent change.
I have no doubt I have overlooked something; any feedback is appreciated.
You can identify path of the configuration file by looking into services:
Open services and find MariaDB Service instance
Right click and click on Properties
You should see something like "C:\path\to\exe" --defaults-file="c:\path-to-ini\my.ini"
then you can edit correct configuration file
I found the solution. After making the changes noted in my post I was attempting to restart MySQL daemon using the Windows Command line and the following command:
C:\Users\david>mysqld restart
2019-03-14 21:05:48 0 [Note] mysqld (mysqld 10.3.12-MariaDB) starting as process 8548 ...
The results can be seen below the command which is mysqld restart
MySQL being installed and run as a Service, clearly this was not the was to restart it; so I restarted it using the Services.msc:
Typing Services.msc into the search bar
Selecting Services
In the Services app find MySQL
Right clicking MySQL and selecting
Restart
This caused the my.ini file to be reread.

Where to change the value of `lower_case_table_names=2` on windows mysql?

I am using Windows 10. I am trying to create a tables with the first letter in the name with uppercase for example: User, but I canĀ“t find the file that contains lower_case_table_names variable.
I know this is 2 years late but I hope to help others with similar problem.
For those that does not use xampp, the MySQL configuration file should be located at C:\ProgramData\MySQL\MySQL Server 5.7.
Alternatively, you can use MySQL Workbench software to change lower_case_table_names variable.
Run MySQL Workbench software with administration right (Meaning: right click the software icon and "Run as administrator").
Connect to your database.
Find Options File under the left panel (Navigator > Instance > Options File)
In General tab, tick lower_case_table_names to modify the value to 2.
Click Apply to save the changes.
Credits to Technology Explained
FYI, remember to restart the MySQL server to reflect the changes!
Do these steps:
open your MySQL configuration file: [drive]\xampp\mysql\bin\my.ini
look up for: # The MySQL server [mysqld]
add this right below it: lower_case_table_names = 2
save the file and restart MySQL service
From: http://webdev.issimplified.com/2010/03/02/mysql-on-windows-force-table-names-to-lowercase/

Where to change the value of lower_case_table_names=2 in XAMPP on Windows?

I am using Windows 7 and XAMPP. I am trying to export my database and while in the process the table names are converted to lower case.
I have searched a lot, I know I have to change the value of lower_case_table_names from 0 to 2, but where do I have to change this value, in which file?
Do these steps:
open your MySQL configuration file: [drive]\xampp\mysql\bin\my.ini
look up for: # The MySQL server [mysqld]
add this right below it: lower_case_table_names = 2
save the file and restart MySQL service
From: http://webdev.issimplified.com/2010/03/02/mysql-on-windows-force-table-names-to-lowercase/
On linux I cannot set lower_case_table_names to 2 (it reverts to 0), but I can set it to 1.
Before changing this setting, do a complete dump of all databases, and drop all databases. You won't be able to drop them after setting lower_case_table_names to 1, because any uppercase characters in database or table names will prevent them from being referenced.
Then set lower_case_table_names to 1, restart MySQL, and re-load your data, which will convert everything to lowercase, including any subsequent queries made.
Try adding/editing lower_case_table_names = 2 in my.ini or my.cnf
I have same problem while importing database from linux to Windows.
It lowercases Database name aswell as Tables' name.
Use following steps for same problem:
Open c:\xampp\mysql\bin\my.ini in editor.
look for
# The MySQL server
[mysqld]
3 . Find
lower_case_table_names
and change value to 2
if not avail copy this at the end of this [mysqld] portion.
lower_case_table_names = 2
This will surely work.
Also works in Wampserver.
Click on the Green Wampserver Icon, choose MySql, then my.ini.
This will allow you to open the my.ini file.
Then -
look up for: # The MySQL server [mysqld]
add this right below it: lower_case_table_names = 2
save the file and restart MySQL service
Important Note - add the lower_case_table_names = 2 statement NOT under the [mysql] statement, but under the [mysqld] statement
Reference - http://doc.silverstripe.org/framework/en/installation/windows-wamp
If you have the file my-default.ini rename it to my.ini
ADD following -
look up for: # The MySQL server [mysqld]
add this right below it: lower_case_table_names = 1
In file - /etc/mysql/mysql.conf.d/mysqld.cnf
It's works for me.
Look for a file named my.ini in your hard disk, in my system it's in
c:\program files\mysql\mysql server 5.1
If it's not my.ini it should be my.cnf
On Mysql Server 8.0 Windows os, if you change lower_case_table_names=2 in mysql.ini the server will not start so you have to follow this
1: Backup all data / export to .sql or Dump all data
2: Stop the server from service
3: Delete the data folder from C:\Program Files\ Mysql Server 8.0\Data
4: Open C:\Program Files\ Mysql Server 8.0\my.ini as an administrator using notepad
5: find set lower_case_table_names= 2 if you want camelCase table name
6: open mysql installer and open reconfigure then open ->show advanced and logging option -> Advanced Options -> use second option from the list
7: then everything will be ok