This section helps first timers to quickly setup MySQL environment so Dbvisit Repicate can be configured after that to establish proof of concept in testing environment.
...
No Format | ||
---|---|---|
| ||
/etc/init.d/mysqld start |
Use mysql command to connect to The MySQL server. This program is started by executing the command mysql at the shell prompt. You can connect using following command. You can find more information about MySQL and configuring authentication here
No Format | ||
---|---|---|
| ||
mysql -u root |
...
No Format | ||
---|---|---|
| ||
DROP TABLE IF EXISTS `avi_objects`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `avi_objects` (
`OWNER` varchar(30) default NULL,
`OBJECT_NAME` varchar(128) default NULL,
`SUBOBJECT_NAME` varchar(30) default NULL,
`OBJECT_ID` bigint(20) default NULL,
`DATA_OBJECT_ID` bigint(20) default NULL,
`OBJECT_TYPE` varchar(19) default NULL,
`CREATED` date default NULL,
`LAST_DDL_TIME` date default NULL,
`TIMESTAMP` varchar(19) default NULL,
`STATUS` varchar(7) default NULL,
`TEMPORARY` varchar(1) default NULL,
`GENERATED` varchar(1) default NULL,
`SECONDARY` varchar(1) default NULL,
`NAMESPACE` bigint(20) default NULL,
`EDITION_NAME` varchar(30) default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1; |
Some handy MySQL tips:
1) To change the password for the MySQL root user:
No Format |
---|
mysql> UPDATE mysql.user SET Password = PASSWORD('root') WHERE User = 'newpasswd';
mysql> FLUSH PRIVILEGES; |
2) To allow a remote host to connect from a different server other than the local host on MySQL. This is needed when the following error message is received: "ERROR 1130 (HY000)": Host 'xxxxx' is not allowed to connect to this MySQL server
First determine the current privileges:
No Format |
---|
mysql> SELECT host FROM mysql.user WHERE User = 'root';
+-----------+
| host |
+-----------+
| 127.0.0.1 |
| localhost |
| target |
+-----------+ |
Now add privilege to connect from a server called "source":
No Format |
---|
GRANT ALL PRIVILEGES ON *.* TO 'root'@'source';
FLUSH PRIVILEGES; |
Note |
---|
Ensure you understand MySQL privileges fully on your production server before running this command as it may open expose the database too much. Reduce the privileges as required. |
The new privileges look like:
No Format |
---|
mysql> SELECT host FROM mysql.user WHERE User = 'root';
+-----------+
| host |
+-----------+
| 127.0.0.1 |
| localhost |
| target |
| source |
+-----------+ |
3) To allow access for a specific remote user to connect to MySQL. This is needed when the following error message is received: ERROR 1045 (28000): Access denied for user 'root'@'source' (using password: YES)
No Format |
---|
mysql> GRANT ALL ON root.* TO 'root'@'source' IDENTIFIED BY 'root'; |
Note |
---|
Ensure you understand MySQL privileges fully on your production server before running this command as it may open expose the database too much. Reduce the privileges as required. |