linux下mysql⼆进制⽂件()安装
⼆进制⽂件()安装:
先创建⽤户和⽤户组
su - root
groupadd mysql
useradd -g mysql mysql
解压⼆进制⽂件。
gunzip -c filename | tar -xf -
复制⽬录/home/mysql到/usr/local;
创建mysql许可表:
linux:/usr/local/mysql #scripts/mysql_install_db --user=mysql
设置⼆进制所有权,使之归root所有,并属于mysql所在管理组:
linux:/usr/local/mysql # chown -R root /usr/local/mysql
宿舍的数组词linux:/usr/local/mysql # chgrp -R mysql/usr/local/mysql
将数据⽬录的所有权设置为mysql管理⽤户:
linux:/usr/local/mysql # chown -R mysql /usr/local/mysql/data
启动服务器:
进制转换方法 短除法linux:/usr/local/mysql # bin/mysqld_safe --user=mysql &
登⼊:
linux:/usr/local/mysql # bin/mysql -u mysql
mysql>show databases;
最初只有两个:test,information_schema;
以root⾝份登⼊则有四个。
运⾏命令bin/mysql -u root -p,此时将出现password:(要求输⼊密码),但默认情况下root⽤户没有密码,所以回车即可。此时将进⼊MySQL界⾯,当然仍然只是个命令⾏窗⼝⽽以。
运⾏命令use test,将进⼊test数据库
mysql>use test;
mysql> show tables
-> ;
Empty set (0.00 sec)
建⽴⼀个地址簿数据库:
mysql> create database address;
mysql> use address;
Database changed
创建表:
mysql> create table friends (name Char(15),telphone VarChar(20),qq Char(10), address VarChar(30));
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'create table friends (name Char(15),telphone VarChar(20),qq Char(10), address ' at line 1
mysql> create table friends (name Char(15),telphone VarChar(20),qq Char(10), address VarChar(30));
Query OK, 0 rows affected (0.01 sec)
新增⼏笔资料,并查询看看:
mysql> insert into friends values("xyf","123456","359830463","浙江");
Query OK, 1 row affected (0.00 sec)
mysql> insert into friends values
-> (
-> "myblue",
-> "6743133"
-> ,"464313113",
-> "zhejiang");
Query OK, 1 row affected (0.00 sec)
mysql> select * from friends;
+--------+----------+-----------+----------+
| name | telphone | qq | address |
+--------+----------+-----------+----------+
| xyf | 123456 | 359830463 | 浙江 |
| myblue | 6743133 | 464313113 | zhejiang |
+--------+----------+-----------+----------+
2 rows in set (0.00 sec)微商城平台
创建和修改密码:
#在控制台上输⼊
linux:/usr/local/mysql # bin/mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or /g.
手机mysql安装配置教程Your MySQL connection id is 18
Server version: 5.1.12-beta MySQL Community Server (GPL)
Type 'help;' or '/h' for help. Type '/c' to clear the buffer.
mysql> update user set password=password('1234') where user='root'; mysql> FLUSH PRIVILEGES;
mysql> exit
Bye
linux:/usr/local/mysql # bin/mysql -u root -p1234
Welcome to the MySQL monitor. Commands end with ; or /g.
Your MySQL connection id is 20
Server version: 5.1.12-beta MySQL Community Server (GPL)
Type 'help;' or '/h' for help. Type '/c' to clear the buffer.mysql截取字符串中的数字
mysql>学excel的软件
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论