LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-25-2014, 04:52 PM   #1
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
dashes in a mysql database


So, I'm doing this migration of Wordpress sites (ok, 520 of them, eek)
and one of the databases has dashes, or hyphens in it.
and I expect even more to have these dashes.

Near as I can tell the original host (phpmyadmin 2.8.1 login only shows)
"MySQL - 4.1.12" and "MySQL client version: 4.1.12"
The new db host has version: 5.1.73

The client did an export and imported it onto the new host I don't know how, Workbench, TOAD, something and it shows up on the new host as
Code:
/var/lib/mysql/aa@002dbb@002dcc@002ddd/
and shows up in "show databases" as aa-bb-cc-dd

I had to use backticks around the aa-bb-cc-dd when I issued the grant. No big deal there.

My concern is if I don't change the db to aa_bb_cc_dd I've read that all sorts of scary things will come up, such as mysqldump hates dashes|hyphens, and
I may have some unintended side-affects wrt: PHP code. (PHP treats dashes as minus no matter how they're escaped)?

Can someone tell me if we can expect Zero code changes if I allow the database name on the new host to remain with dashes?

GOD, I hope this isn't too confusing to anyone.

Thanks for your valuable time.

Last edited by Habitual; 08-26-2014 at 09:04 AM.
 
Old 08-26-2014, 01:42 AM   #2
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
Within strings PHP will not treat dashes as minus.
 
1 members found this post helpful.
Old 08-26-2014, 09:25 AM   #3
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374

Original Poster
Blog Entries: 37

Rep: Reputation: Disabled
Thanks j-ray.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
postfix +Cyrus SASL authentication problem + pam-mysql+mysql database kibirango Slackware 1 12-25-2012 08:47 AM
[SOLVED] yum install php-mysql create problem to my running mysql database jsaravana87 Linux - Server 1 08-11-2011 03:24 AM
How do I create a new mysql user and a mysql database at the shell prompt? puppymagic Linux - Newbie 1 08-07-2010 06:33 AM
How can i copt the MYSQL Database to a other server (Database) halvorls Linux - Server 3 07-27-2008 09:19 PM
Writing an app that uses a mysql database without installing mysql server? QtCoder Programming 4 08-09-2004 02:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration