mysql在命令行输入mysql --user=grails入门指南 -p --database=racetrack_dev 报错 ERROR 1045<28000> 求解决办法

MySQL 5.5 Reference Manual :: 4.5.1 mysql — The MySQL Command-Line Tool
MySQL 5.5 Manual
Section Navigation &&&&&[]
4.5.1 mysql — The MySQL Command-Line Tool
is a simple SQL shell with input line
editing capabilities. It supports interactive and noninteractive
use. When used interactively, query results are presented in an
ASCII-table format. When used noninteractively (for example, as
a filter), the result is presented in tab-separated format. The
output format can be changed using command options.
If you have problems due to insufficient memory for large result
sets, use the
option. This
to retrieve results from the
server a row at a time rather than retrieving the entire result
set and buffering it in memory before displaying it. This is
done by returning the result set using the
function in the client/server library rather than
is very easy. Invoke it from the
prompt of your command interpreter as follows:
shell& mysql db_name
shell& mysql --user=user_name --password=your_password db_name
Then type an SQL statement, end it with
“;”, \g, or
\G and press Enter.
Typing Control+C causes
to attempt to kill the current
statement. If this cannot be done, or Control+C
is typed again before the statement is killed,
You can execute SQL statements in a script file (batch file)
like this:
shell& mysql db_name & script.sql & output.tab
On Unix, the
client logs statements
executed interactively to a history file. SeeIn this article, let us review how to install MySQL on CentOS using yum. Instead of searching and installing mysql and related packages one-by-one, it is better to install MySQL using yum groups.
If you are interested in installing the full LAMP stack, refer to our earlier article on .
1. Identify the Group name of MySQL Packages
yum grouplist displays all package groups that are available in the repository. As shown below, mysql package group is called “MySQL Database”.
# yum grouplist | grep -i mysql
MySQL Database
2. What is bundled in the “MySQL Database” group?
yum groupinfo displays all the packages that are bundled in a group. This displays the mandatory, default and optional packages that are available in that particular group.
As shown below, “MySQL Database” group contains 1 mandatory package, 6 default packages, and 5 optional packages.
# yum groupinfo "MySQL Database"
Group: MySQL Database
Description: This package group contains packages useful for use with MySQL.
Mandatory Packages:
Default Packages:
MySQL-python
libdbi-dbd-mysql
mysql-connector-odbc
mysql-server
perl-DBD-MySQL
Optional Packages:
mod_auth_mysql
mysql-bench
mysql-devel
3. Install the “MySQL Database” group using yum groupinstall
yum groupinstall will install the “MySQL Database” group of packages as shown below.
# yum groupinstall "MySQL Database"
Resolving Dependencies
Dependencies Resolved
Transaction Summary
=========================
12 Package(s)
0 Package(s)
0 Package(s)
Installed:
MySQL-python.i386 0:1.2.1-1 libdbi-dbd-mysql.i386 0:0.8.1a-1.2.2
mysql.i386 0:5.0.77-4.el5_4.2
mysql-connector-odbc.i386 0:3.51.26r1127-1.el5
mysql-server.i386 0:5.0.77-4.el5_4.2
perl-DBD-MySQL.i386 0:3.0007-2.el5
unixODBC.i386 0:2.2.11-7.1
Dependency Installed:
libdbi.i386 0:0.8.1-2.1 libdbi-drivers.i386 0:0.8.1a-1.2.2
libtool-ltdl.i386 0:1.5.22-7.el5_4
mx.i386 0:2.0.6-2.2.2 perl-DBI.i386 0:1.52-2.el5
Note: If you are having some issues during the installation, verify the
to see what you are missing.
4. Verify MySQL Installation
Execute rpm -qa, to confirm that the mysql related packages are installed.
# rpm -qa | grep -i mysql
MySQL-python-1.2.1-1
mysql-5.0.77-4.el5_4.2
mysql-connector-odbc-3.51.26r1127-1.el5
mysql-server-5.0.77-4.el5_4.2
libdbi-dbd-mysql-0.8.1a-1.2.2
perl-DBD-MySQL-3.0007-2.el5
Check the /etc/passwd and /etc/group to make sure it has created a mysql username and group.
# grep mysql /etc/passwd
mysql:x:27:27:MySQL Server:/var/lib/mysql:/bin/bash
# grep mysql /etc/group
mysql:x:27:
5. MySQL Post installation – Execute mysql_install_db
mysql_install_db program will setup the necessary grant tables. The mysql_install_db program gets executed as part of the rpm installation. But, it doesn’t hurt to execute the mysql_install_db program again to make sure the grant tables are setup properly.
# /usr/bin/mysql_install_db --user=mysql
Installing MySQL system tables...OK
Filling help tables...OK
The latest information about MySQL is available on the web at
6. Start MySQL Server
# service mysqld status
mysqld is stopped
# service mysqld start
Starting MySQL:
7. Verify that the MySQL server is up and running.
# /usr/bin/mysqladmin version
/usr/bin/mysqladmin
Ver 8.41 Distrib 5.0.77, for redhat-linux-gnu on i686
Copyright (C)
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license
Server version
Protocol version 10
Connection
Localhost via UNIX socket
UNIX socket
/var/lib/mysql/mysql.sock
Threads: 1
Questions: 2
Slow queries: 0
Flush tables: 1
Open tables: 6
Queries per second avg: 0.051
# /usr/bin/mysqlshow
+--------------------+
+--------------------+
| information_schema |
+--------------------+
# /usr/bin/mysqlshow mysql
Database: mysql
+---------------------------+
+---------------------------+
| columns_priv
| help_category
| time_zone_transition
| time_zone_transition_type |
+---------------------------+
Stop and start the mysql server again to make sure they are no issues.
# service mysqld stop
Stopping MySQL:
# service mysqld start
Starting MySQL:
Change the MySQL root account password
Change the MySQL root account password to something secure.
# mysql -u root
Welcome to the MySQL monitor.
Your MySQL connection id is 5
Server version: 5.0.77 Source distribution
Type '' or '\h' for help. Type '\c' to clear the buffer.
mysql> select host, user from mysql.
+-----------+------+
+-----------+------+
| 127.0.0.1 | root |
| localhost |
| localhost | root |
+-----------+------+
5 rows in set (0.00 sec)
mysql> set password for 'root'@'localhost' = PASSWORD('DoNotTell$AnyBody');
Query OK, 0 rows affected (0.00 sec)
mysql> set password for 'root'@'127.0.0.1' = PASSWORD('DoNotTell$AnyBody');
Query OK, 0 rows affected (0.00 sec)
Make sure you are able to login to MySQL using the new password as shown below.
# mysql -u root
ERROR ): Access denied for user 'root'@'localhost' (using password: NO)
# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.
Your MySQL connection id is 7
Server version: 5.0.77 Source distribution
Type '' or '\h' for help. Type '\c' to clear the buffer.
If you enjoyed this article, you might also like..
Leave a Comment
& - Practical Examples to Build a Strong Foundation in Linux
- Take Control of Your Bash Command Line and Shell Scripting
- Enhance Your UNIX / Linux Life with Sed and Awk
- Practical Examples for Becoming Fast and Productive in Vim Editor
- Monitor Everything, Be Proactive, and Sleep Well
POPULAR POSTS
CATEGORIES
Support Us
Support this blog by purchasing one of my ebooks.
Contact Us
Email Me :
to get in touch me with your comments, questions or suggestions about this site. You can also simply drop me a line to say hello!.
Copyright &
Ramesh Natarajan. All rights reserved建立你的第一个Grails应用_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
评价文档:
喜欢此文档的还喜欢
建立你的第一个Grails应用
是​偶07​年​翻​译​自​《​G​e​t​t​i​n​g​ ​s​t​a​r​t​e​d​ ​w​i​t​h​ ​g​r​a​i​l​s​》​一​书​。
阅读已结束,如果下载本文需要使用
想免费下载本文?
把文档贴到Blog、BBS或个人站等:
普通尺寸(450*500pix)
较大尺寸(630*500pix)
你可能喜欢 下载
 收藏
该文档贡献者很忙,什么也没留下。
 下载此文档
正在努力加载中...
grails-问题
下载积分:200
内容提示:grails 问题
文档格式:PDF|
浏览次数:6|
上传日期: 00:51:23|
文档星级:
该用户还上传了这些文档
grails-问题.PDF
官方公共微信TutorialsBASH ShellTroubleshootingNginxNetworkingMySQLGoogle Cloud PlatformAmazon Cloud ComputingRackspace Cloud ComputingLinuxCentOSDebian / UbuntuUbuntu LinuxSuseRedHat and FriendsSlackware LinuxUNIXAIXMac OS XFreeBSDFreeBSD Jails (VPS)OpenbsdSolarisSee all tutorial topicsContact usForumLinux Scripting GuideRSS/FEEDShopLinux FAQ / HowtosI'm trying to make backups using the mysqldump command and getting the following error or warning:mysqldump: Got error: 1044: Access denied for user 'root'@'localhost' to database 'information_schema' when using LOCK TABLESHow do I fix this problem?
You can pass the --single-transaction option to mysqldump command: $ mysqldump --single-transaction -u user -p DBNAME > backup.sql Another option is to grant LOCK TABLES to your user: $ mysql -u root -p
And type: mysql> GRANT SELECT,LOCK TABLES ON DBNAME.* TO 'username'@'localhost'; Sample Shell Script#!/bin/bash
# Purpose: Backup mysql
# Author: Vivek G under GNU GPL v2.0+
NOW=$(date +&%d-%m-%Y&)
DEST=&/.backup/mysql&
# set mysql login info
MUSER=&root&
# Username
MPASS='PASSWORD-HERE'
# Password
MHOST=&127.0.0.1&
# Server Name
# guess binary names
MYSQL=&$(which mysql)&
MYSQLDUMP=&$(which mysqldump)&
GZIP=&$(which gzip)&
[ ! -d &${DEST}& ] && mkdir -p &${DEST}&
# get all db names
DBS=&$($MYSQL -u $MUSER -h $MHOST -p$MPASS -Bse 'show databases')&
for db in $DBS
FILE=${DEST}/mysql-${db}.${NOW}-$(date +&%T&).gz
# get around error
$MYSQLDUMP --single-transaction -u $MUSER -h $MHOST -p$MPASS $db | $GZIP -9 & $FILE
doneFacebook itG+ itDownload PDF version Featured Articles:30 Cool Open Source Software I Discovered in 2013 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS XTop 30 Nmap Command Examples For Sys/Network Admins25 PHP Security Best Practices For Sys Admins20 Linux System Monitoring Tools Every SysAdmin Should Know20 Linux Server Hardening Security TipsLinux: 20 Iptables Examples For New SysAdminsTop 20 OpenSSH Server Best Security Practices Top 20 Nginx WebServer Best Security Practices20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors15 Greatest Open Source Terminal Applications Of 2012My 10 UNIX Command Line MistakesTop 10 Open Source Web-Based Project Management SoftwareTop 5 Email Client For Linux, Mac OS X, and Windows UsersThe Novice Guide To Buying A Linux Laptop Leave a Comment Subscribe to nixCraftLearn something new about Linux/Unix by emailEnter your email address:
Latest posts from our blogA Shell Primer: Master Your Linux, OS X, Unix Shell Environment7 Awesome Open Source Cloud Storage Software For Your Privacy and Security20 Unix Command Line Tricks – Part I5 Awesome Open Source Backup Software For Linux and Unix-like Systems8 Tips to Solve Linux & Unix Systems Hard Disk Problems Like Disk Full Or Can’t Write to the Disk

我要回帖

更多关于 grails 中文参考手册 的文章

 

随机推荐