Summary: | MySQL database creation failed when path to the database contains Cyrillic characters | ||
---|---|---|---|
Product: | [Applications] amarok | Reporter: | Artem Vorotnikov <artem> |
Component: | Collections/Local | Assignee: | Amarok Developers <amarok-bugs-dist> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | matej, ralf-engels |
Priority: | NOR | ||
Version: | 2.7.0 | ||
Target Milestone: | 2.8 | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/amarok/e90f7b4b8462e674275b53d550c147bbececd467 | Version Fixed In: | 2.7.1 |
Sentry Crash Report: |
Description
Artem Vorotnikov
2013-01-26 02:57:03 UTC
Try running this as normal user (NOT as root): mysqlcheck --auto-repair --all-databases Also I strongly recommend you use Amarok 2.7, sadly you didn't specify which version this is about. (In reply to comment #1) > Try running this as normal user (NOT as root): > > - > > Also I strongly recommend you use Amarok 2.7, sadly you didn't specify which > version this is about. I have switched to gentoo, but still get the same error Amarok 2.7.0, compiled w/ embedded USE flag Your command yields mysqlcheck: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) when trying to connect Sounds like a problem on your side, then, please make sure your MySQL is compiled with -fPIC enabled and check your file system permissions. Which MySQL version do you use? (In reply to comment #3) > Sounds like a problem on your side, then, please make sure your MySQL is > compiled with -fPIC enabled and check your file system permissions. Which > MySQL version do you use? MySQL 5.5.29-r1 and do you want me to compile Amarok w/ standalone sql server (USE="-embedded")? Mmmm guess what? I don't get the error when I start Amarok via kdesu. This is clearly related to my using Unicode. (In reply to comment #5) > Mmmm guess what? I don't get the error when I start Amarok via kdesu. This > is clearly related to my using Unicode. Sorry, but that statement makes no sense :) And it also makes no sense that you run Amarok with root rights, but it clearly shows that there is a permissions issue on your MySQL installation, please make sure that the folder content of $HOME/.kde/share/apps/amarok/mysqle/amarok/ has correct permissions, it should be -rw-rw---- (In reply to comment #6) > (In reply to comment #5) > > Mmmm guess what? I don't get the error when I start Amarok via kdesu. This > > is clearly related to my using Unicode. > > Sorry, but that statement makes no sense :) And it also makes no sense that > you run Amarok with root rights, but it clearly shows that there is a > permissions issue on your MySQL installation, please make sure that the > folder content of $HOME/.kde/share/apps/amarok/mysqle/amarok/ has correct > permissions, it should be -rw-rw---- Deleted the folder, started Amarok as normal user. Still the same error. You deleted the folder? That was your database, I didn't tell you to delete it... You didn't answer my question about the MySQL version and whether it was compiled with -fPIC enabled, because this is most likely a problem with your MySQL installation, not with Amarok. Since mysqlcheck didn't allow you to repair the database and gave you an error this is most likely the culprit (In reply to comment #8) > You deleted the folder? That was your database, I didn't tell you to delete > it... > > You didn't answer my question about the MySQL version and whether it was > compiled with -fPIC enabled, because this is most likely a problem with your > MySQL installation, not with Amarok. > > Since mysqlcheck didn't allow you to repair the database and gave you an > error this is most likely the culprit I don't know if it was compiled with -fPIC (I didn't force it, at least) I created a new user in latin alphanumerics and this problem is NOT present. Then something is wrong in your user configs, try erasing your $HOME/.kde/share/config/amarok* for your previous user. Please take this to the forum at http://forum.kde.org/amarok, it is not an issue that belongs in the bug tracker. (In reply to comment #10) > Then something is wrong in your user configs, try erasing your > $HOME/.kde/share/config/amarok* for your previous user. > > Please take this to the forum at http://forum.kde.org/amarok, it is not an > issue that belongs in the bug tracker. I have wiped all Amarok settings for cyrillic user but I still got the same error on startup. This is an issue with Amarok/MySQL handling of UTF-8 characters, probably because of Qt's internal usage of UTF-16. Nevertheless, it clearly belongs to the bug tracker. GREPME MySQLe query failed! (1) Can't create/write to file '/home/аÑÑÑм/.kde/share/apps/amarok/mysqle/amarok/db.opt' (Errcode: 2) on Could not alter database charset/collation This is the error. Note the "аÑÑÑм" part. Most likely Qt sends the аÑÑÑм instead of артём to MySQL. In order to solve it, Amarok has to invoke QString::fromUtf8 when sending the path to MySQL. I suspect it's an Amarok bug. (Quickly scanned through the code base, so take this with a grain of salt). MySqlEmbeddedStorage.cpp uses QString::toAscii() to store the database directory location from memory to my.cnf. The data location ('$HOME/.kde/...') itself comes from kdelibs's KGlobal::dirs(), that should not be an issue wrt encoding. (In reply to comment #13) > I suspect it's an Amarok bug. (Quickly scanned through the code base, so > take this with a grain of salt). > > MySqlEmbeddedStorage.cpp uses QString::toAscii() to store the database > directory location from memory to my.cnf. > The data location ('$HOME/.kde/...') itself comes from kdelibs's > KGlobal::dirs(), that should not be an issue wrt encoding. Changing datadir = /home/аÑÑÑм/.kde4/share/apps/amarok/mysqle to datadir = /home/артём/.kde4/share/apps/amarok/mysqle does not work. Moreover, on the launch of Amarok home path in my.cnf becomes mojibake again. (In reply to comment #14) This is the cause: > Moreover, on the launch of Amarok home path in my.cnf becomes > mojibake again. This is the consequence: > Changing > datadir = /home/аÑÑÑм/.kde4/share/apps/amarok/mysqle > to > datadir = /home/артём/.kde4/share/apps/amarok/mysqle > > does not work. > > MySqlEmbeddedStorage.cpp uses QString::toAscii() to store the database > > directory location from memory to my.cnf. Looks like an easy fix, I'll have a look at it. Git commit 7b8266baf2f0c3afac70b8cbbc561c473a6f1322 by Matěj Laitl. Committed on 09/04/2013 at 22:40. Pushed by laitl into branch 'master'. MySqlEmbeddedStorage: don't use QString::toAscii(), fix bug 313914 It is 2013. We have more characters than 128. BUGFIXES: * Fix inability to create database when home directory contains non-ASCII characters. FIXED-IN: 2.8 M +2 -0 ChangeLog M +3 -3 src/core-impl/collections/db/sql/mysqlecollection/MySqlEmbeddedStorage.cpp http://commits.kde.org/amarok/7b8266baf2f0c3afac70b8cbbc561c473a6f1322 Git commit e90f7b4b8462e674275b53d550c147bbececd467 by Matěj Laitl. Committed on 09/04/2013 at 22:40. Pushed by laitl into branch 'v2.7.x'. MySqlEmbeddedStorage: don't use QString::toAscii(), fix bug 313914 It is 2013. We have more characters than 128. BUGFIXES: * Fix inability to create database when home directory contains non-ASCII characters. M +2 -0 ChangeLog M +3 -3 src/core-impl/collections/db/sql/mysqlecollection/MySqlEmbeddedStorage.cpp http://commits.kde.org/amarok/e90f7b4b8462e674275b53d550c147bbececd467 |