database name problem

I am on the installation/server page. 4.0.1

I am trying to enter “MySQL database name” but it has a problem as the mysql has a “-” in the name which it does not like. I cannot change the first part as this is automatically created for me by the hosting control panel, only the bit after the “-” sign can i change

I have something like xyz224-cs4 and the error I get is “MySQL database name can contain only Latin characters, numbers, and underscores”

What can i do to resolve this.

Have also put this in the bug tracker.

Any help appreciated.

Ask your host why it is using a “-”. Most use a “_” in between. xyz224_cs4

Agreed. Having a hyphen in the database name causes all sorts of issues if you use command line statements in MySQL so it's really the hosting company's bad setup decisions rather than a bug in CS-Cart.

Well I've sent a support ticket to the hosting company and the reply is they cant change the mysql prefix so I'm now stuck till there is a cs cart update to the problem.

I have the same exact issue, and came here to post about it when I found this.



My host have this setup for all MySQL accounts and I use it on my current 2.2.5 version and it works well.

Why did they change the requirements for CS-Cart ?



Good thing you posted it in the Bugs section.

I take it this issue was never resolved? Just trying to install the latest version and am having this problem too.

I edited my install file to accept a hyphen and all seems to be working fine. In install/app/Installer/Validator.php on line 222 change:
if (preg_match('/^[0-9a-zA-Z$_]{1,63}$/', $name)) {
to
if (preg_match('/^[0-9a-zA-Z$_-]{1,63}$/', $name)) {
and it installed perfectly. Not sure why it's an issue, the hosting company I use is a good one and would not use a hyphen if there was an issue.David

To clarify the post above, you need to edit the file /install/app/Installer/Validator.php and edit the code as above.