简体   繁体   English

MySQL在本地主机和生产之间的不同字符串

[英]Different strings in MySQL between localhost and production

I would need your help on this one because I can't find the solution myself: 我需要您的帮助,因为我自己找不到解决方案:

I have a project built on cakephp ver 2.5.1. 我有一个基于cakephp ver 2.5.1构建的项目。 I'm entering data into my database on localhost (MAMP on my macbook; VARCHAR 255 utf8_bin - string being saved: HP) and all strings saved on my localhost appear in numbers (string HP is being saved as 4850). 我正在将数据输入到本地主机上的数据库中(macbook上的MAMP; VARCHAR 255 utf8_bin-正在保存的字符串:HP),并且在本地主机上保存的所有字符串都以数字显示(字符串HP被保存为4850)。

The funny thing is if I copy that same database and import it on my production server all the strings are correct, HP is HP and not 4850... so I'm guessing I just misconfigured something on localhost... 有趣的是,如果我复制相同的数据库并将其导入生产服务器中,那么所有字符串都是正确的,HP是HP,而不是4850。

Any help on the matter will be greatly appreciated! 任何对此事的帮助将不胜感激!

尝试以下操作:在phpmyadmin表显示页面中,单击“ +选项”链接,然后取消选中“将二进制内容显示为十六进制”

Check what the column type is in your local host. 检查本地主机中的列类型。 I'm thinking that you might have created the column as an integer instead of a varchar or text. 我认为您可能已将列创建为整数而不是varchar或text。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM