Search:

Dream

Server

Info

edit SideBar

Server / MySQL

Followed this guide.

Installing and Configuring MySQL Database Server

sudo su - 
yum update
yum install mysql-server
chkconfig --levels 235 mysqld on
service mysqld start
mysql_secure_installation

Follow the instructions provided by the mysql_secure_installation script. Set a root password, disable remote access, remove anonymous user, remove default database.

Create user, database, and tables

mysql -u root -p Connect to the mysql server with the root account.
At the 'mysql>' prompt, enter the following.
CREATE DATABASE telemetry; CREATE USER 'payload'@localhost IDENTIFIED BY 'CHANGEME'; GRANT ALL PRIVILEGES ON telemetry.* TO 'payload'@localhost;

CREATE TABLE telemetry (
id int(11) NOT NULL auto_increment,
primary KEY (id),
gpsAltitude MEDIUMINT(6),
latitude DECIMAL(10,3),
longitude DECIMAL(10,3),
temperature DECIMAL(5,2),
barometricPressure SMALLINT(4),
humidity DECIMAL(5,2),
batteryVoltage DECIMAL(4,2),
timestamp TIMESTAMP); 

exit

Recovering MySQL Root Password

sudo su - Switch to root user.
service mysqld stop Stop the MySQL server.
mysqld_safe --skip-grant-tables Start MySQL server in safe mode.
mysql -u root Connect to MySQL server as root.
At 'mysql>' prompt:
USE mysql; UPDATE user SET PASSWORD=PASSWORD("CHANGEME") WHERE USER='root'; "CHANGEME" would be the new root password.
FLUSH PRIVILEGES; exit This leaves the 'mysql>' prompt.

service mysqld restart Restart to apply changes.


Page last modified on June 17, 2013, at 03:15 PM