I've only been using MySQL for a short time. When on the "SQL" tab, using the text input for queries is only allowing me to type in uppercase letters.
I can't think why this has happened as only yesterday it was working fine.
I've attached an image to show you what I mean.
A few things to note:
My caps lock is OFF
If I run a query like the one shown in the image it does in fact create the database with a lowercase name.
Similarly, If I was to press shift to create a capital - it does that fine too
I'm working off my MAMP localhost version 4.0.2
The issue is that I can't see my upper/lowercase characters while writing the query itself which means I may find it harder to accurately target certain elements of the database.
Does anyone know why this might be happening? Is it as simple as changing a setting?
I have never seen anything like this, but I know the .ini file has a setting lower_case_table_names to set table names to lower case. I do not know MAMP but certainly check the .ini file. Also if you have not been using MySQL that long maybe change to EasyPHP (Apache, PHP and phpMyAdmin - works great for me.
Related
I apologise in advance for I know that this question has been asked several times already, but being a complete beginner at wordpress coding and database handling, I am still not sure about what those answers really meant.
So having just coded a website and converted it into WordPress, I now find myself having to change all of the localhost strings to the accurate ones, but with hundreds to go through, I just wanted to know if any of you were able to recommend a program or technique within PHPMyAdmin (that I may not be aware of) to avoid having to change them one at a time.
Thank you all in advance for your time and attention.
First, let me start by saying this is very dangerous, especially for an absolute beginner such as yourself. Please use this with extreme caution as you can potentially bring the entire site down by replacing values in your database with the wrong data.
With that said, there is a script specifically designed for doing search and replace on the WordPress MySQL database. http://interconnectit.com/products/search-and-replace-for-wordpress-databases/
Here's the direct download link: https://github.com/interconnectit/Search-Replace-DB/archive/master.zip
You will extract the folder from the donwloaded zip, then upload the folder to the root of your WordPress install. Once its uploaded just reference the folder in the browser. I always rename the folder to sr (shorthand for search and replace) so its easier to write out the full URL. So as an example, once its in the root of the WordPress install you'd access it like www.example.com/sr/.
After you access the script in the browser, you'll have a GUI with two boxes at the top. The first you'll enter the string you're searching for, and the replace string goes in the second box. Your MySQL details/login should already be populated. After entering your S&R terms scroll down and click "Update Details", then do the "Dry Run" option first. It'll run through the database and show you the values that will be changed. If you are satisfied with the changes, click "Live Run".
Depending on the database size it'll take just a short time to complete. This is the easiest way to S&R the WordPress database.
Important: for security reasons you'll want to delete this folder from your server after you have finished using it. You don't want a database S&R utility just lingering around for no reason.
Another possible option if you're familiar with WP-CLI is to use the wp search-replace command: https://developer.wordpress.org/cli/commands/search-replace/ This would be done through Terminal or another command line utility.
In phpMyAdmin open your table, choose Search > Find and replace. Then specify in which column you want to find and replace, and the original and replacement texts.
Without any doubt I would use http://interconnectit.com/products/search-and-replace-for-wordpress-databases/
This tool is especially designed for the situation you describe.
You upload the code to your server and then enter the "find" and "replace"
You can then do a dry run and the system will show you all the replaces that will be made across every single table in your Wordpress database.
Once you're happy then you can do a live run and the changes are made.
I have used this on probably one hundred Wordpress sites and it works a charm.
I am using MySQL Server 5.7 and MySQL Workbench 6.3 CE on Windows 10. I have sifted through several pages of questions related to this on multiple websites, including Stack Overflow, but cannot figure out where I can amend the server so that it is is configured with lower_case_table_names=2, rather than lower_case_table_names=1.
Many answers I have seen point to finding either a file ending in 'my.ini' or 'my.cnf', neither of which I can locate on my disc. Truthfully speaking, I am a beginner with SQL, and had difficulty understanding the tutorial page that many users have pointed to, which is:
http://dev.mysql.com/doc/refman/5.7/en/identifier-case-sensitivity.html
Virtually every resource I am learning from references uppercase table names, columns, etc., which is why I want to use uppercase versus lowercase.
For example, if I create a table called EmployeeInfo and a few columns, I get this error when I click "Apply":
Apply Changes to Object
The server is configured with lower_case_table_names=1, which only allows lowercase characters in schema and table names. The object will be created as 'employeeinfo'.
I want the table to be called EmployeeInfo. I do not want it to be in lowercase. However, I cannot locate the supposed 'my.ini', or 'my.cnf' files that have been mentioned in other answers pertaining to this question.
Or is it a best practice to get used to using lowercase font as you move further with SQL?
EDIT:
I believe I have located the so-called 'my.ini' file, although, there is no 'ini' file type. It is labeled 'Configuration settings'.
However, I cannot find anything related to 'lower_case_table_name=1' inside after searching.
EDIT 2:
I found the 'lower_case_table_names' option in the System Options File and changed it to '2'.
However, when I click 'Apply', it tells me:
Could not Save Configuration File
The error looks like this:
Error
This problem is with Docker itself when you upgrade to latest release, This happened with me when upgraded. Try to downgrade Docker to your earlier version.
MySQL 5.7 specs seem to generally recommend sticking with lowercase table names.
...To avoid problems caused by such differences, it is best to adopt a
consistent convention, such as always creating and referring to
databases and tables using lowercase names. This convention is
recommended for maximum portability and ease of use...
Anyways, here is how you view that variable setting:
SHOW variables like 'lower_case_table_names';
And here is how you change that variable setting to allow your CamelCase:
lower_case_table_names = 1 (<- put in your mysql config file)
restart mysql
I solved this error on MySql 8.0 and with Windows 10 by doing the following: -
I started MySQl Workbench CE as an adminstrator
I changed the Windows directory path attributes for: "C:\Program Files\MySQL\MySQL Server 8.0", from "Read Only" to "Full/Write"
In the MYSQL Workbench Window, I selected "Local Instance MYSQL80" tab
On the left-side of the window, I went to "Navigator" - "Instance" - "Options File"
In the Options window I went to "General" - "System"
I clicked on "lower_case_table_names". I left the attribute at 0
If you look 3 items below, you will see "offline_mode". Make sure it is ticked
Lastly, I clicked the "Apply" button
Everything went through! Reboot MySQL - just to make sure!
*Please note that I am not sure if it was necessary to make changes to the ini source directory attributes at point number "2"! Please test by changing the directory attributes back to "Read"!
So when I downloaded the MySQL and used workbench, it shows like this so I could not edit the data type here, which is different from others. I have tried reinstalled MySQL and workbench yet the problem remains.
Can someone point out what's going wrong? Thank you so much!
This is a regression introduced when the details pane had been made visible in modeling too (it is always visible in the SQL IDE). With the next update the default height for the table editor will be increased so that you can see the columns table immediately. Of course you can always resize the editor (there is a splitter right above the editor, which you can drag for resizing).
I switched an self developed Web-Application based on Perl/CGI and MySQL from one server to another and since then, special characters from database content like german umlauts are shown as black diamond with question mark. Everything else, even text with umlauts which is coming from the script is ok. After lot of research I have still no clue what might cause the issue.
The original server is openSuSE 13.1 with Perl 5.18.1 and MySQL 5.6.25 while the new server is Debian 8 with Perl 5.20.2 and MySQL 5.5.44. I transfered all files with zipped tar files and configured MySQL and Apache identically, i.e. setting utf-8 and so on. After dumping and restoring sql data I was able to verify that data in new MySQL is fine.
I tried many things so far, playing around with use Encode and use utf8 in Perl, setting DBI with utf8 but nothing helps. Feel quite lost now, so any hint is appreciated. Let me know if more info is necessary.
Kind regards,
Uwe
The post suggested by bytepusher helped me. When I use use utf8; AND use open ':std', ':encoding(UTF-8)'; everything works fine. However, I am still wondering why it did work without these statements on the old machine...
I'm looking for something similar to the table creation form from phpmyadmin, but it should simply display a CREATE TABLE statement in a textarea below the form.
It should also not require MySQL, PHP, or even a server to work.
I want this for times I'm working on projects and just want to whip up a quick table definition. I'll more than likely always have a text editor open, so being able to save to file isn't a must-have.
I'm on Ubuntu and use Gnome. A tiny GTK application I could stick in my Applications menu would be ideal.
It's not that hard to get familiar enough with the syntax that knocking out a table definition in a text editor becomes second nature.
However, check out DBDesigner4, which is a GPL application which might be useful to you.
Use the MySQL Workbench: http://dev.mysql.com/downloads/workbench/5.0.html
Download and install it.
To see the screen you want, you have to open a connection first under "Open Connection to Start Querying".
Enter your root password (or other, if your connection is for another user).
Then your SQL Editor should immediately open.
From the left column, under 'schemas', open your database,
then right-click on 'Tables'.
Select 'Create Table.'