Change Xampp Mysql to display errors in Portuguese - mysql

I'm trying to change mysql to return the error in Portuguese.
I already added in the file my.ini the line "lc-messages = pt_BR"
It still keeps returning the error in English.
Does anyone know how to help me in this?
Before I came to ask for help I already researched and could not solve this
My version of Xampp is v3.2.1
PS: Sorry for the English

Changing the language is not so much a XAMPP nor PHP thing but rather involves a MySQL configuration file aka an option file. Take a look here. You should change your my.ini file to include this server command option:
lc-messages=pt_BR
If you are using XAMPP 3.2.1, then you most likely are using MySQL5.6 and the correct way to express this locale change option is to write "lc-messages", i.e. use a hyphen and not an underscore in an option file or on the commandline; see here.
Be sure to save the file and then you should restart the MySQL server.
Note: the actual environment variable is lc_messages.

Related

I am getting an error when setting up mysql

I am a new programer for sql.
I have install the SQL application on my laptop then I am going over to my computer and clicking on properties then changing the advance system settings from there and from there I am going to the environment variable and I am adding a new path for sql
I am going to cmd prompt in my Windows to install the database but it's giving me and error, which says cannot find the file specified
enter image description here
Without seeing your PATH it's hard to know what's up. But generally speaking, make sure the mysql path can be found, and if it can be found, make sure that the employees.sql is indeed in the correct folder.

MySQL 8.0.3 defaults file missing in a running instance

Due to some configuration issue, I found out that I need to change a MySQL server parameter. However, MySQL was running in Windows "Services" as "C:\MySQL\bin\mysqld MySQL" which I understand does not provide a "defaults-file".
My question is,
Is there a default "defaults file" ? I searched for any *.ini or *.cfg file and could not find any.
Is there a sample file for this version I can download somewhere ? I tried some old files but there are some compatibility issues with previous versions.
Thanks in advance
MySQL Server has "default defaults" built-in. No options file is necessary to get these defaults.
You can find all the default values for every option in the manual: https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html
It's recommended to leave the defaults alone unless you have a specific reason to change one. Then make your own edits to your local options file.
It's a good idea to add comments to the options file so you have a record of why you changed each value away from its built-in default.

MySQL80 Service on local computer started and the stopped. How to solve?

I'm receiving this error of MYSQL80 service on local computer started and stopped. Some services stop automatically if they are not in use by other services or programs. when I try to start my MySQL server from the services.msc
I already run mysqld --install and mysqld --initialize. Already tried to change the properties of the service to local system account. I checked my.ini file, it is in Program Data folder, the Uploads folder exists as well. I also checked the .err file but nothing is helpful there, the last line is something like 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. that I don't really know what it means and google didn't help.
I don't know what else to try, I tried pretty much everything that I found.
This is my path to executable, do you think this should point to my.ini file? If so, how do I change that?
Also, there is another MySQL service on the list which I can start, but it's empty, my database is on the MySQL80 server (the one that I cannot start):
Any idea?
I am assuming that the password you enter is valid and still it's showing a login error.
I had the same issue just to allow the table to CSV export. I made some changes in my.ini and the service mysql80 never started.. after searching everywhere I came to the conclusion that we need to uninstall the MySQL server (Just server) and reinstall it.
Don't worry your databases will be safe just uninstall MySQL server "Control Panel\All Control Panel Items\Programs and Features" and reinstall MySQL server. MySQL installer-> add->mysql server 8.X.X, and try login again.
Hope this help just worked like magic for me.
If using version 8 and you edit the my.ini I found that Notepad is putting 3 hex characters at the beginning of the my.ini file. EF BB BF. Deleting the 3 characters from the beginning of the file in a hex editor fixes the problem.
In version 8 they are accidentally putting Unicode characters in the ini file. This is causing Notepad to save the file with Byte order mark characters.
The following line in the file is the culprit "The line # range from 1 to 2^32 − 1. “Unique” means that each ID must be different." has 3 Unicode characters. This is causing notepad to append the byte order mark to the text file.
The other solution is to replace the my.ini file if you have a backup.
Stop the service mysql and start the services mysql80.
That's what I did and worked.

"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

How come doing a find/replace on sql dump and importing it gives error #2006?

I have the sql dump for a wordpress install that lives on a domain. I need to make some changes to the site so I have set up a localhost using MAMP.
If I import the sql dump "as-is" it imports without a problem. However I need to change all the URL's in the sql dump to point to localhost instead.
When I use Aptana to do a replace all on the sql file from http://example.com to http://localhost/example and try to import the modified file to mysql I get the error "#2006 - MySQL server has gone away"
What is the problem here? I have temporarily fixed by overriding my hosts file for example.com to point to my localhost but this is not a long term viable option.
I am aware this error usually occurs for files that are too large or the server not responding but I am always able to import the non-modified version of the sql. Also there are 9538 replaces being done so I cannot go through 1 by 1 to find the culprit.
Thank you
(Just realized that it doesn't relate DIRECTLY to your problem, but you still need this info if you are doing Search and Replace in your MySQL dump).
Data in the WP database is serialized. You can't just search and replace.
You can't just change the data without re-serializing it.
There are scripts and services that allow you to do a proper Search and Replace.
I usually use this tool (git repository here), and it works perfectly. There are also a couple plugins that work, and just discovered this service from a theme creation company that does the same thing.
Good luck and happy wordpressing.