免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 4347 | 回复: 10
打印 上一主题 下一主题

免安装mysql修改root密码,有时出错?谢谢回复!在线等待 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-08-24 10:40 |只看该作者 |倒序浏览
我是把noninstall的mysql放在我们的软件当中,安装的时候一起复制。
先注册系统服务:mysqld --install mysql
然后启动服务:net start mysql
接着修改密码:mysqladmin -uroot password 111111
可是执行到此处的时候,有时候会出错,有时候没有问题?请教各位是什么原因啊?
万分感谢!!

论坛徽章:
0
2 [报告]
发表于 2009-08-24 10:54 |只看该作者
下面是my.ini:
# Example MySQL config file for large systems.
#
# This is for a large system with memory = 512M where the system runs mainly
# MySQL.
#
# You can copy this file to
# /etc/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options (in this
# installation this directory is C:\mysql\data) or
# ~/.my.cnf to set user-specific options.
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the "--help" option.

# The following options will be passed to all MySQL clients
[client]
#password        = your_password
port                = 3306
socket                = /tmp/mysql.sock

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
basedir="F:/mysql/mysqlserver/"
datadir="F:/mysql/mysqlserver/data/"
default-character-set=latin1      #utf8
default-storage-engine=innodb
max_allowed_packet =12M

port                = 3306
socket                = /tmp/mysql.sock
skip-locking
key_buffer = 256M
max_allowed_packet = 1M
table_cache = 256
sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size= 16M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 8

# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (via the "enable-named-pipe" option) will render mysqld useless!
#
#skip-networking

# Disable Federated by default
skip-federated

# Replication Master Server (default)
# binary logging is required for replication
log-bin=mysql-bin

# required unique id between 1 and 2^32 - 1
# defaults to 1 if master-host is not set
# but will not function as a master if omitted
server-id        = 1

# Replication Slave (comment out master section to use this)
#
# To configure this host as a replication slave, you can choose between
# two methods :
#
# 1) Use the CHANGE MASTER TO command (fully described in our manual) -
#    the syntax is:
#
#    CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
#    MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
#
#    where you replace <host>, <user>, <password> by quoted strings and
#    <port> by the master's port number (3306 by default).
#
#    Example:
#
#    CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
#    MASTER_USER='joe', MASTER_PASSWORD='secret';
#
# OR
#
# 2) Set the variables below. However, in case you choose this method, then
#    start replication for the first time (even unsuccessfully, for example
#    if you mistyped the password in master-password and the slave fails to
#    connect), the slave will create a master.info file, and any later
#    change in this file to the variables' values below will be ignored and
#    overridden by the content of the master.info file, unless you shutdown
#    the slave server, delete master.info and restart the slaver server.
#    For that reason, you may want to leave the lines below untouched
#    (commented) and instead use CHANGE MASTER TO (see above)
#
# required unique id between 2 and 2^32 - 1
# (and different from the master)
# defaults to 2 if master-host is set
# but will not function as a slave if omitted
#server-id       = 2
#
# The replication master for this slave - required
#master-host     =   <hostname>
#
# The username the slave will use for authentication when connecting
# to the master - required
#master-user     =   <username>
#
# The password the slave will authenticate with when connecting to
# the master - required
#master-password =   <password>
#
# The port the master is listening on.
# optional - defaults to 3306
#master-port     =  <port>
#
# binary logging - not required for slaves, but recommended
#log-bin=mysql-bin

# Point the following paths to different dedicated disks
#tmpdir                = /tmp/               
#log-update         = /path-to-dedicated-directory/hostname

# Uncomment the following if you are using BDB tables
#bdb_cache_size = 64M
#bdb_max_lock = 100000

# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = C:\mysql\data/
#innodb_data_file_path = ibdata1:10M:autoextend
#innodb_log_group_home_dir = C:\mysql\data/
#innodb_log_arch_dir = C:\mysql\data/
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
#innodb_buffer_pool_size = 256M
#innodb_additional_mem_pool_size = 20M
# Set .._log_file_size to 25 % of buffer pool size
#innodb_log_file_size = 64M
#innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[isamchk]
key_buffer = 128M
sort_buffer_size = 128M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer = 128M
sort_buffer_size = 128M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

论坛徽章:
0
3 [报告]
发表于 2009-08-24 11:05 |只看该作者
最让上郁闷的一点时,执行到这一句的时候有时候没有问题,有时候出现问题。真的很头疼,都好几天了,还是没有解决,希望知道原因的大侠帮帮忙啊?谢谢了

论坛徽章:
9
每日论坛发贴之星
日期:2016-01-04 06:20:00数据库技术版块每日发帖之星
日期:2016-01-04 06:20:00每日论坛发贴之星
日期:2016-01-04 06:20:00数据库技术版块每日发帖之星
日期:2016-01-04 06:20:00IT运维版块每日发帖之星
日期:2016-01-04 06:20:00IT运维版块每日发帖之星
日期:2016-01-04 06:20:00综合交流区版块每日发帖之星
日期:2016-01-04 06:20:00综合交流区版块每日发帖之星
日期:2016-01-04 06:20:00数据库技术版块每周发帖之星
日期:2016-03-07 16:30:25
4 [报告]
发表于 2009-08-24 11:21 |只看该作者
报的什么错呢?

论坛徽章:
0
5 [报告]
发表于 2009-08-24 11:41 |只看该作者
mysqladmin:connect to server at 'localhost' failed
error:cat't connect to mysql server on 'localhost'<10061>'
check that mysqld is running on localhost
and that the port is 3309.you can check this by doing 'telnet localhost 3309'

请问露露这是什么原因啊?怎么有时候成功,有时候会这样呢?

论坛徽章:
0
6 [报告]
发表于 2009-08-24 11:58 |只看该作者
mysqladmin  -P3309 -uroot password 111111

端口是3309?

论坛徽章:
0
7 [报告]
发表于 2009-08-24 12:00 |只看该作者
重新启动机器看看,你安装了几个MYSQL ,曾经安装过吗?检查下 计算机服务管理里,启动时那个?

论坛徽章:
0
8 [报告]
发表于 2009-08-24 12:38 |只看该作者
是的,我把端口号改为3309了。我每次安装后失败后,都会mysqld --remove mysql,再重启装。
执行到mysqladmin -uroot  password ,有时候成功,有时候失败。修改成功了,删除服务,重装后,密码仍为重装前密码,是不是没有清理干净?

论坛徽章:
9
每日论坛发贴之星
日期:2016-01-04 06:20:00数据库技术版块每日发帖之星
日期:2016-01-04 06:20:00每日论坛发贴之星
日期:2016-01-04 06:20:00数据库技术版块每日发帖之星
日期:2016-01-04 06:20:00IT运维版块每日发帖之星
日期:2016-01-04 06:20:00IT运维版块每日发帖之星
日期:2016-01-04 06:20:00综合交流区版块每日发帖之星
日期:2016-01-04 06:20:00综合交流区版块每日发帖之星
日期:2016-01-04 06:20:00数据库技术版块每周发帖之星
日期:2016-03-07 16:30:25
9 [报告]
发表于 2009-08-24 13:12 |只看该作者
报的这个错说明是mysql服务没起来,装好以后确认下mysql服务处于启动状态。
然后telnet一下3309端口,确认mysql是起在3309上,然后再改密码。
楼主的环境应该是windows吧?是的话注意下安全卫士360关掉。

至于删除重装后的密码不变,说明你只删除了程序文件,而没有把数据文件删除。

论坛徽章:
0
10 [报告]
发表于 2009-08-24 13:56 |只看该作者
是的。我的环境是windows。
可为什么使用了net start mysql却没有启动mysql服务呢?为什么有的时候是成功的,有的时候却失败了呢?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP