添加mysql用户
mysql>grant select,insert,update,delete,create,drop on database.employee to user@localhost identified by "123"; 给来自localhost的用户user分配可对数据库database的employee表进行select,insert,update,delete,create,drop等操作的权限,并设定口令为123。
mysql>grant select,insert,update,delete,create,drop on database.employee to user@localhost identified by "123"; 给来自localhost的用户user分配可对数据库database的employee表进行select,insert,update,delete,create,drop等操作的权限,并设定口令为123。
$ sudo /etc/init.d/mysql stop $ sudo /etc/init.d/apache2 stop $ sudo cp -rf /var/lib/mysql YOURS/mysql $ sudo mv /var/lib/mysql /var/lib/mysql.bakd $ sudo /etc/init.d/mysql start Starting MySQL database server: mysqld...failed or took more than 6s. Please take a look at the syslog. /usr/bin/mysqladmin: connect to server at 'localhost' failed error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)' Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists! $ sudo rm -rf /var/run/mysqld $ sudo /etc/init.d/mysql start Starting MySQL database server: mysqld...failed or took more than 6s. Please take a look at the syslog. /usr/bin/mysqladmin: connect to server at 'localhost' failed error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)' Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists! google, xxx resolve: $ sudo chown -R mysql YOURS/mysql $ sudo chgrp -R mysql YOURS/mysql $...