access denied for user debian-sys-maint solution

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

<code>for error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: NO)' or something similar: 

<span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 13px; line-height: 19px;">That’s because Debian has a MySQL account </span><code style="font-size: 13px; line-height: 19px;">debian-sys-maint</code><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 13px; line-height: 19px;"> used for switching on/off and checking status. The password for that user should be the same as stored in </span><code style="font-size: 13px; line-height: 19px;">/etc/mysql/debian.cnf</code><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 13px; line-height: 19px;">. The file looks like this:</span></code>
<code># Automatically generated for Debian scripts. DO NOT TOUCH!
[client]
host     = localhost
user     = debian-sys-maint
password = &lt;password&gt;
socket   = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
host     = localhost
user     = debian-sys-maint
password = &lt;password&gt;
socket   = /var/run/mysqld/mysqld.sock
basedir  = /usr</code>
<code>If the password doesn't match (for example because you changed it manually) the init script won't work anymore. You should set the password according to the file. So
</code>
<code>mysql -u root -p
# Then type MySQL root password
GRANT ALL PRIVILEGES ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY '&lt;password&gt;';</code>
<code> </code>

Read More

Linux Backup and Restore MySQL Databases Using mysqldump

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

Quick instructions:
backup: # mysqldump -u root -p[root_password] [database_name] > dumpdatabasefilename.sql

restore:# mysql -u root -p[root_password] [database_name] < dumpdatabasefilename.sql

Backup:
If you want to backup multiple databases at the same time, run show databases in mysql shell:
#mysql -u root -p[password]
mysql> show databases;


Multiple databases backup:
# mysqldump -u root -p[password] --databases database1 database2 > database_1_2.sql

One command to backup all databases in once:
#mysqldump -u root -ppassword --all-databases > all-database.sql

Backup a specific table:
# mysqldump -u root -ptmppassword sugarcrm accounts_contacts \
> /tmp/sugarcrm_accounts_contacts.sql

Restore
Make sure to create the database before you can perform the restore.
# mysql -u root -p[password]
mysql> create database somedatabase;
Query OK, 1 row affected (0.02 sec)
# mysql -u root -p[password] somedatabase < /tmp/somedatabase.sql
# mysql -u root -p[root_password] [database_name] < dumpfilename.sql

Backup a local database and restore to remote server using single command:
[local-server]# mysqldump -u root -p[password] sugarcrm | mysql \
-u root -p[password] --host=remote-server -C sugarcrm1

Read More

Java Servlet International Character Encoding UTF-8 with Hibernate and MySQL 中文显示

Add following script to your hibernate.cfg.xml file. “useUnicode=true&characterEncoding=utf-8”

 <property name="hibernate.connection.url">jdbc:mysql://localhost/yourschema?autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=utf-8</property>

如果你使用Java Servlet, Mysql和Hibernate, 为了正常显示及存储中文, 可以加入以上脚本

如果显示仍然有问题, 可以尝试使用:

String str="中文测试"; new String(str.getBytes("iso-8859-1"), "utf-8"); 

Read More