贝贝爸爸的程序人生

关注Seam、BPM
posts - 23, comments - 10, trackbacks - 0, articles - 32
  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

Fedora16下安装mysql

Posted on 2011-11-25 23:40 贝贝爸爸 阅读(3883) 评论(3)  编辑  收藏 所属分类: Linux数据库
  • yum方式安装及配置
    $> sudo yum install mysql mysql-server mysql-workbench
    # 启动mysql
    $> sudo systemctl start mysql.service
    # 设置自动启动
    $> sudo systemctl enable mysql.service
  • 修改默认字符集,修改/etc/my.cnf文件
  • [mysqladmin]
    user
    =root

    [mysqld]
    datadir
    =/var/lib/mysql
    socket
    =/var/lib/mysql/mysql.sock
    symbolic-links
    =0
    character-set-server
    =UTF8
    port
    =3306

    [mysqld_safe]
    log-error
    =/var/log/mysqld.log
    pid-file
    =/var/run/mysqld/mysqld.pid

    [client]
    default-character-set
    =UTF8
    port
    =3306
    socket
    =/var/lib/mysql/mysql.sock
  • 查看默认字符集
  • mysql> show variables like 'collation_%';
    +----------------------+-----------------+
    | Variable_name        | Value           |
    +----------------------+-----------------+
    | collation_connection | utf8_general_ci |
    | collation_database   | utf8_general_ci |
    | collation_server     | utf8_general_ci |
    +----------------------+-----------------+
    3 rows in set (0.00 sec)
  • 设置root密码
    # 未设置过root密码
    mysqladmin -u root password 
    123456
    # 设置过密码的
    [root@yuan yuan]# mysqladmin -u root -p password
    Enter password: ******
    New password: 123456
    Confirm new password:123456
    [root@yuan yuan]#

评论

# re: Fedora16下安装mysql[未登录]  回复  更多评论   

2012-01-04 15:13 by fedora

$> sudo yum install mysql mysql-server mysql-workbench
过之后, 启动mysql
$> sudo systemctl start mysql.service
提示
Failed to issue method call: Unit mysql.service failed to load: No such file or directory. See system logs and 'systemctl status mysql.service' for details.

# re: Fedora16下安装mysql[未登录]  回复  更多评论   

2012-03-15 19:19 by fg
cheman@cheman ~$ su
密码:
[root@cheman cheman]# systemctl start mysql.service
Failed to issue method call: Unit mysql.service failed to load: No such file or directory. See system logs and 'systemctl status mysql.service' for details.
[root@cheman cheman]#

# re: Fedora16下安装mysql  回复  更多评论   

2012-07-09 22:42 by readilychen
sudo systemctl start mysqld.service@fg

只有注册用户登录后才能发表评论。


网站导航: