{"id":892,"title":"Access Denied Problem When Connecting to Remote MySQL Servers","advertisement_flag":false,"content":"\n\u003cp\u003eIf you are having a MySQL server and want to develop a standalone application to connect to the server remotely, you might experience this connection problem: OperationalError - 1044 - Access denied for user. This post shows you the answer to the problem regardless of the programming language you are using such as Python, Java or .Net.\u003c/p\u003e\n\n\u003cp\u003eIt's very likely that you haven't been granted permissions to connect to your MySQL server remotely. You can check this out by running this command from your local computer: \u003cbr\u003e\u003c/p\u003e\n\n\u003cpre\u003e\n\nmysql.exe -u username -h server.example.com -p\n\n\u003c/pre\u003e\n\n\u003cp\u003eIt means that you need to have an instance of MySQL installed on your computer so that you can have access to the file mysql.exe. If you can connect, it means there are bugs in your code. On the contrary, if you can't connect to your server, it means you don't have permissions to connect remotely. \u003cbr\u003e \u003cbr\u003e\u003c/p\u003e\n\n\u003cp\u003eWhat you have to do is to run this command on your server using SSH to connect: \u003cbr\u003e\u003c/p\u003e\n\n\u003cpre\u003e\n\nGRANT ALL ON my_database.* TO username@'%' IDENTIFIED BY 'some_password';\n\n\u003c/pre\u003e\n\n\u003cp\u003eYou also might find this command doesn't work for you. It's because you are running on a shared server. Hence, you need to send a ticket requesting remote access and the database name you need it enabled for to the admin of the server.\u003c/p\u003e\n","created_at":"2020-11-11T06:51:12.606Z","author_name":"Bob","tag_groups":["database|Database|false"],"author_id":1,"slug":"access-denied-problem-when-connecting-to-remote-mys","parent_id":null,"visits":1522,"likes":0,"image":null}
[]
[]
database
[]
[{"id":891,"name":"Python MySQL Example","short_content":"This is a quick tutorial on how to connect to MySQL Server using Python.\n\nFirstly, you have to get MySQLdb set up on your computer. If you are running ...","likes":0,"slug":"python-mysql-example","tag_groups":["python|Python|false","database|Database|false"],"image":null},{"id":888,"name":"Project Work Vs. Process Work","short_content":"This short video shows you what the difference between Project Work and Process Work. By understanding the difference, you can gain a better understand ...","likes":1,"slug":"project-work-vs-process-work","tag_groups":["project_management|Project Management|false"],"image":null},{"id":890,"name":"Prioritising User Requirements With Kano Analysis","short_content":"Kano Analysis was developed by Professor Noriaki Kano in the 1980s. It is a powerful technique to measure customer satisfaction during the product deve ...","likes":0,"slug":"prioritising-user-requirements-with-kano-analysis","tag_groups":["project_management|Project Management|false"],"image":null},{"id":887,"name":"SugarCRM Print Address Labels","short_content":"This is a continuation of the articles \"SugarCRM Adding Custom Button For Printing Labels Using Javascript\" and \"SugarCRM How To Add Custom Actions\". T ...","likes":0,"slug":"sugarcrm-print-address-labels","tag_groups":["sugarcrm|SugarCRM|false"],"image":null},{"id":889,"name":"SugarCRM How To Add Custom Fields To Modules","short_content":"This short article shows you step-by-step instructions to add custom fields to an existing module such as Accounts.\n\nThis is before you add a custom fi ...","likes":2,"slug":"sugarcrm-how-to-add-custom-fields-to-modules","tag_groups":["sugarcrm|SugarCRM|false"],"image":null}]
[{"id":68,"slug":"linux","name":"Linux","post_name":"Linux"},{"id":69,"slug":"django","name":"Django","post_name":"Django"},{"id":70,"slug":"python","name":"Python","post_name":"Python"},{"id":71,"slug":"sugarcrm","name":"SugarCRM","post_name":"SugarCRM"},{"id":73,"slug":"agile","name":"Agile","post_name":"Agile"},{"id":75,"slug":"business","name":"Business","post_name":"Business"},{"id":76,"slug":"myob","name":"MYOB","post_name":"MYOB"},{"id":77,"slug":"edi","name":"EDI","post_name":"EDI"},{"id":78,"slug":"database","name":"Database","post_name":"Database"},{"id":72,"slug":"project_management","name":"Project Management","post_name":"Project Management"},{"id":74,"slug":"microsoft_office","name":"Microsoft Office","post_name":"Microsoft Office"}]
Tất nhiên, bạn không phải thực hiện bất kỳ thao tác nào trong số này nếu bạn sử dụng một trong các dịch vụ Lưu trữ VPS Linux của chúng tôi, trong trường hợp đó, bạn chỉ cần yêu cầu quản trị viên Linux chuyên nghiệp của chúng tôi khắc phục các lỗi MySQL này cho bạn. Họ luôn sẵn sàng 24×7 và sẽ xử lý yêu cầu của bạn ngay lập tức
Đây là một trong những lỗi phổ biến nhất trong MySQL. Điều đó thường có nghĩa là bạn đang cố gắng kết nối bằng tài khoản người dùng không có đủ đặc quyền để kết nối
Theo mặc định, sau khi cài đặt, MySQL chỉ cho phép kết nối localhost và chặn mọi nỗ lực kết nối từ xa cho đến khi đặc quyền của người dùng được cấu hình lại đúng cách. Điều đó giải thích tại sao bạn không thể kết nối từ máy khách từ xa trong khi các chương trình phía máy chủ khác dường như kết nối mà không gặp sự cố nào
Để thiết lập kết nối từ xa, bạn phải định cấu hình lại và cấp cho nó các đặc quyền phù hợp
GRANT ALL PRIVILEGES ON *.* TO 'user_name'@'host' IDENTIFIED BY "password";
Hoặc
________số 8
Đối với mục đích thử nghiệm, bạn có thể khởi động máy chủ bằng tùy chọn
[]4
$ mysqld --skip-grant-tables
Sau đó, bạn có thể truy cập các bảng cấp phép của MySQL bằng cách sử dụng câu lệnh
[]5 để kiểm tra các đặc quyền và thay đổi nếu bạn muốn
[]0
Khi hoàn tất, tuôn ra các đặc quyền
[]1
Nếu sự cố chỉ phát sinh với tài khoản root sau khi nâng cấp MySQL, thì có khả năng plugin xác thực đã thay đổi thành auth_socket theo mặc định. Vậy bạn có thể làm gì để thay đổi phương thức xác thực từ auth_socket thành mysql_native_password
[]2
Sau đó tuôn ra đặc quyền
[]1
Cần một công cụ GUI tốt cho cơ sở dữ liệu?