Register   Login   About   Study   Enterprise   Share
AI / Internet Technology University (AITU)
Fast Login - available after registration







|

Top Links: >> 80. Technology >> Internet Technology Summit Program >> 5. Mobile and Cloud Technology >> 5.2. AWS Cloud Technology >> 5.2.1. AWS Cloud Setting with Java, Tomcat, MySQL and Route 53
Current Topic: 5.2.1.2. AWS MySQL EC2 User setting
You have a privilege to create a quiz (QnA) related to this subject and obtain creativity score...
5.2.1.2. AWS MySQL EC2 User setting

Login to the EC2-USER shell window at AWS.Amason.com
// get root access
>sudo -i
// try to start mysql - check if installed in your area
>service mysqld start

// if not, install mysql-server
>yum install mysql-server

// start the server
>service mysqld start

// make a password for the root account (Note that initial password usually is not set for the root, so we do not need to say -p at the end and we do ot need to provide default password, which is "" - nothing)
>mysqladmin -u root password '{new_password}'

// This command might fail, because the assumption is "No initial password for root".
// If this is not a case use the following to get "temporary password" provided by default in the beginning.

>sudo grep 'temporary password' /var/log/mysqld.log

// Then use this password
>mysqladmin -u root -p
Enter Password:{provide that temporary password}

// If you use MySQL 5.7.6 and later:

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';

// If you use MySQL 5.7.5 and earlier:

mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPass');

// MySQL client will start and you can alter this root password and provide other settings
// Note that the password has Capital and small letter, a number and a special character.

//Run MySQL as root and providing the password:
>mysql -u root -p
Enter Password: {new_password}

// create a new schema (database) and grant privileges to a new user
mysql>create database {db name};

mysql> CREATE USER '{userName}'@'localhost' IDENTIFIED BY '{password}'
-> ;
Query OK, 0 rows affected (0.03 sec)
Was it clear so far?

mysql> GRANT INSERT, UPDATE, DELETE ON Books TO userName}t@localhost;
or
mySql>grant all privileges on {db name}.* to '{user_name}'@'localhost';

mySql>show databases;

mysql> show databases;
+------------------------+
| Database |
+------------------------+
| information_schema |
| {your DB_name} |
| mysql |
| performance_schema |
| test |
+------------------------+

// Create a table with field names and data types - see a sample below
mysql> create table {db_name}.{table_name} ({table_name_ID} INTEGER NOT NULL PRIMARY KEY, {field1} text, {field2} varchar(399), UPDATEDBY varchar(60, UPDATEDTIME TIMESTAMP);

Make MySQL DB case insensitive to table names

While moving to LINUX environment it is possible that MySQL becomes picky.
The same table names that worked before are "not found". MySQL can be case sensitive to table names.
Here is how to make it behave, turn off case sensitivity.

//Edit my.cnf - configuration file

sudo -i

vi /etc/my.cnf

// the my.cnf file can be in another place, but most common place in AWS EC2 environment is under /etc

// If you prefer MySql to be not case sensitive to the table names
// Underneath the [mysqld] section.add:

lower_case_table_names = 1

// increase wait_timeout value to 999999 sec so JDBC is not closing connections too soon
// also provide big enough: max_allowed_packet = 128M
[mysqld]
wait_timeout=9999999
interactive_timeout=9999999
max_allowed_packet = 128M
//Restart mysql

service mysqld restart
Topic Graph | Check Your Progress | Propose QnA | Have a question or comments for open discussion?
Comments
2017-07-12_18:40 by Joe Tijerina

Have a suggestion? - shoot an email
Looking for something special? - Talk to me
Read: IT of the future: AI and Semantic Cloud Architecture | Fixing Education
Do you want to move from theory to practice and become a magician? Learn and work with us at Internet Technology University (ITU) - JavaSchool.com.

Technology that we offer and How this works: English | Spanish | Russian | French

Internet Technology University | JavaSchool.com | Copyrights © Since 1997 | All Rights Reserved
Patents: US10956676, US7032006, US7774751, US7966093, US8051026, US8863234
Including conversational semantic decision support systems (CSDS) and bringing us closer to The message from 2040
Privacy Policy