Start Mysql: Log in To Your Linux Computer Using Your User Account
Start Mysql: Log in To Your Linux Computer Using Your User Account
su
[yourusername@localhost yourusername]$
to
[yourusername@localhost yourusername]#
On any Linux computer, there are regular users and the Root
user. Giving the su command allows you to give commands as
the “Super User,” or Root user, of the computer.
The Root user has the power to really mess up the computer, so
you should only work as the Root user when necessary.
/etc/rc.d/init.d/mysql start
/etc/rc.d/init.d/mysql status
6. Type:
exit
[yourusername@localhost yourusername]$
• mysql
• -u root
The -u command tells the MySQL client that you want to log
into the MySQL server as a particular user. root denotes
the root user of the MySQL server.
You’re not logging into the Linux computer as the Root user;
you’re logging into the MySQL server as its root user. This
gives you total control over the MySQL server.
8. Type:
This string of commands sets the password for the root user on
the MySQL server to textbook.
SHOW DATABASES;
The other databases, mysql and tmp, are used by the MySQL
server to store information about users, permissions, etc. The
test database is often used as a workplace for MySQL users to
test and try things – this is useful in a work environment where
many people are working with critical information.
show databases;
USE us_presidents;
rpm –i MySQL-3.23.51-1.i386.rpm ►►
MySQL-client-3.23.51-1.i386.rpm
• INT
The INT datatype for the id field ensures it will contain only
integers—numbers, not text.
• PRIMARY KEY
This means the name table can’t have two records with an
id of 35.
• AUTO_INCREMENT
• CHAR
The CHAR datatype for the first and last fields limits the
length of entries to 25 characters each.