切换用户
| sudo su postgres |
| psql postgres |
查询当前postgres下的DB列表
查看postgres下角色的详细信息(权限)
删除odoo角色
删除数据库
修改数据库密码
| su postgres |
| psql -U postgres |
| alter user postgres with password '要设置的密码'; |
| create role 要创建的数据库名称 with password '要设置的密码' SUPERUSER INHERIT CREATEDB CREATEROLE login; |
创建新角色设置密码为odoo 权限设置为超级管理员 可插入 可创建DB 可登录
如何重启服务
查看进程ID号
快速杀死进程
如何重启DB服务
| /etc/init.d/postgresql stop |
| /etc/init.d/postgresql start |
查看log
| tail -f /home/Documents/log |
假如报错 ImportError: No module named Crypto.Signature 错误时
| sudo pip install pycrypto |
解决psycopg2安装不上得问题
| sudo apt-get install python-psycopg2 |
| sudo apt-get install libpq-dev |
如果没有ImportError: No module named pychart
报错
| /usr/bin/env: 'python\r': No such file or directory |
| :set ff=unix |
| :wq |
Odoo安装根目录下的requirements.txt文档(注意要在该目录下执行)
| pip install -r requirements.txt |
| python -m pip install -r requirements.txt |
修改配置文件更改端口号
赋权命令
启动odoo方法
| /home/odoo-dev/odoo-server/odoo-bin -c /home/odoo-dev/odoo.conf |
Linux查看Odoo进程
Mac查看Odoo端口号
| lsof -i tcp:8069 |
| |
| could not connect to server: Connection refused Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432? |
找到conf配置文件
| sudo find / -name postgresql.conf |
修改配置
定位到listen_addresses 将 "localhost"改成 "*" 或者你主机的ip地址例如:"123.123.123.123"
找到conf配置文件
| sudo find / -name pg_hba.conf |
修改配置 使其接受所有的站点的访问
| host all all 127.0.0.1 32 md5 |
将 127.0.0.1/32 改成 0.0.0.0/0
Q2:再次用python或者图形化界面连接,报错。
| psql: FATAL: password authentication failed for user "postgres" |
| FATAL: password authentication failed for user "postgres" |
解决方法
| sudo find / -name pg_hba.conf |
修改认证方式(method),将md5或者peer改为trust,然后保存。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步