![]() Mysql> FLUSH PRIVILEGES - Required each time one makes a change to the GRANT table mysql> GRANT ALL PRIVILEGES ON bedrock.* TO Dude1 VALUES ('', ' Dude1', password(' supersecret'), 'Y') Mysql> INSERT INTO user (Host, User, Password, Select_priv) Your MySQL connection id is 1 to server version: 3.23.41 The admin tables are stored in the database "mysql". The command mysql with the correct login/password ![]() FLOAT(M,N) : FLOAT(4,2) - Four digits total of.If M is defined to be 200 but the string is 20 characters long, Always stores MĬharacters whether it is holding 2 or 20 characters. Mysql> INSERT INTO employee VALUES ('Betty Rubble','IT','Neighbor') Mysql> INSERT into employee values ('Barney Rubble','Sales','Neighbor') Mysql> INSERT INTO employee VALUES ('Wilma Flinstone','Finance','Analyst') Mysql> INSERT INTO employee VALUES ('Fred Flinstone','Quarry Worker','Rock Digger') | Field | Type | Null | Key | Default | Extra | Mysql> DESCRIBE employee - View table just created. Also refers to path: /var/lib/mysql/bedrock mysql> create table employee (Name char(20),Dept char(20),jobTitle char(20)) Mysql> use bedrock - Specify database to connect to. Mysql> show databases - List all databases in MySQL. Show all mysql databases: mysqlshow -u root -p passwordĬonnect to database and issue the following SQL commands: (or use SQL command: CREATE DATABASE bedrock ) $ mysqladmin -h localhost -u root -p password create bedrock Create a database: (Creates directory /var/lib/mysql/bedrock).Mysql> UPDATE user SET Password=PASSWORD(' new-password') WHERE user='root' Note: the following SQL commands will also work: $ mysqladmin -u root -p old-password password ' new-password' The database "root" password can also be set with the command mysqladmin $ mysqladmin -u root password ' new-password'Īll subsequent password changes will require the specification of the current password: You can use the following command to reset the database "root" password:Īlso look at the mysql_secure_installation man page to see the full list of the command's capabilities. The first step is to assign the database "root" user a password.Red Hat/CentOS/AWS: sudo service mysqld restart.The secure install script will give the following error if you don't start the database first.ĮRROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)) Sudo /usr/libexec/mysql55/mysql_secure_installation : AWS uses a secure install script to force the setting of the default root password: Default config file installed by RPM: /etc/my.cnf.The database executes as user mysqld and group mysqld. The install script will not be run again as long as the default database directory exists. Only executes the first time the MySQL init script is run. ![]() The init script will run /usr/bin/mysql_install_db to create a defaultĭatabase in /var/lib/mysql/ if the mysql init script has never been run before.There is no penalty to trying to stop a database that has already been stoppped. I use the command word "restart" instead of "start" because the database might already be running.Ubuntu/Debian: /etc/init.d/mysql restart.In the configuration file /etc/sysconfig/network Use the command hostname to give your system a hostname and also set Systems a host name if you get the following installation error:ĮRROR: 1062 Duplicate entry 'localhost-root' for key 1ĮRROR: 1062 Duplicate entry 'localhost-' for key 1 Should have a host name other than the default "localhost". Import key: rpm -import pubkey_mysql.asc.Gpg -export -a 5072e1f5 > pubkey_mysql.asc (Saves key 0x5072E1F5 as file pubkey_mysql.asc) Download public key named from with one of two methods:.Installing RPM packages: If installing newer versions of MySQLįrom RPM packages obtained from, you must first import and register Install: rpm -ivh mysql- version.rpm mysql-server- version.rpm mysql-config- version.rpmĬheck if installed: rpm -q mysql mysql-server mysql-configĪlso see package management - using RPM to set GPG signatures and install RPM packages. php-mysql- version.rpm (Optional: For accessing MySQL database from php).mysql-devel- version.rpm (Optional: C include files and libraries for developers).mysql-config- version.rpm (Required config file: /etc/my.cnf).The MySQL Database Installation and configuration:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |